Cedarmaps vue components (map, layers, sources, controls)

Last update: Dec 26, 2020

Map.ir

CedarMaps SDK for Vue

What is CedarMaps?

CedarMaps is the location data platform for mobile and web applications. We provide building blocks to add location features like maps, search, and navigation into any experience you create. Use our simple and powerful APIs & SDKs and our open source libraries for interactivity and control.

Sign up for CedarMaps

Not a CedarMaps user yet? Sign up for an account here. Once you’re signed in, all you need to start building is a CedarMaps access token.


This guide will take you through the process of integrating CedarMaps into your Vue application.

This package is a wrapper over Vue Mapbox library.

Table of Contents

Installation

Npm

npm install vue-cedarmaps mapbox-gl --save

Yarn

yarn add vue-cedarmaps mapbox-gl

use global component

import CedarMaps from 'vue-cedarmaps'
import Vue from 'vue'
import 'mapbox-gl/dist/mapbox-gl.css'

Vue.use(CedarMaps) // this will add CedarMaps ... global components

manual import

import { Cedarmaps, MglMarker, MglNavigationControl, MglFullscreenControl } from 'vue-cedarmaps'
import 'mapbox-gl/dist/mapbox-gl.css'

export default {
  // ...
  components: { Cedarmaps, MglMarker, MglNavigationControl, MglFullscreenControl },
  // ...
}

Rendering Component

">
<template>
  <div id="app">
    <div class="map-container">
        <Cedarmaps
          style="height: 600px"
          :center="center"
          token="token"
          :zoom="12"
        >
          <MglMarker :coordinates="marker" color="blue"/>
          <MglNavigationControl position="top-right" />
          <MglFullscreenControl />
        </Cedarmaps>
      </div>
  </div>
</template>

<script>
import { Cedarmaps, MglMarker, MglNavigationControl } from "vue-cedarmaps";
import 'mapbox-gl/dist/mapbox-gl.css'

export default {
  name: "app",
  components: {
    Cedarmaps,
    MglNavigationControl,
    MglMarker
  },
  data() {
    return {
      center:{ lng: '51.652878', lat: '32.60999' }
      marker: [51.652878, 32.60999]
    };
  },
};
</script>

<style>
* {
  padding: 0;
  margin: 0;
}
.map-container {
  height: 600px;
}
</style>

You can read more about Vue Mapbox in Vue Mapbox Documentation

Example

You can consult this example for getting acquainted with our package.

GitHub

https://github.com/pamenary/vue-cedarmaps
You might also like...

a simple component to generate an static google map

a simple component to generate an static google map

vue-static-map a simple component to generate an static google map Google Documentation Demo SandBox JSBin example Requirements Vue 2.X.X Usage Instal

May 17, 2022

A simple map & geolocation field, built on top of open-source services and Mapbox. Kirby 3 only.

A simple map & geolocation field, built on top of open-source services and Mapbox. Kirby 3 only.

Kirby Locator A simple map & geolocation field, built on top of open-source services and Mapbox. Overview This plugin is completely free and published

Jun 25, 2022

This component allows you to display custom HTML content on the map using Overlay

This component allows you to display custom HTML content on the map using Overlay

vue3-gmap-custom-marker This component allows you to display custom HTML content on the map using Overlay. This component is an update (a fork) from e

Apr 1, 2022

Kartobuilder - a php package for the laravel framework that works with the inertia jetstream stack to build your own map

Kartobuilder is a php package for the laravel framework that works with the inertia jetstream stack to build your own map.

May 3, 2022

🗺 Map Module for Nuxt 3

@nuxtjs/map Map module for Nuxt ✨ Release Notes 📖 Read the documentation Features Nuxt 3 ready Easy integration with Google Maps & Leaflet Use only t

May 1, 2022

🗺 Vue Mapbox GL - A small components library to use Mapbox GL in Vue

🗺 Vue Mapbox GL A small components library to use Mapbox GL in Vue. Installation & usage Have a look at the small guide for information on how to set

Jul 21, 2022

Vue 2 components for Leaflet maps

Vue 2 components for Leaflet maps

Vue2Leaflet Vue2Leaflet is a JavaScript library for the Vue framework that wraps Leaflet making it easy to create reactive maps. How to install npm in

Aug 13, 2022

Vue 2.x components for CesiumJS.

Vue 2.x components for CesiumJS.

VUE CESIUM Vue 2.x components for CesiumJS. Load Cesium built package or other third-party packages which are built on Cesium. Languages 中文 English Li

Aug 16, 2022

A set of composable components for easy use of Google Maps in your Vue 3 projects.

A set of composable components for easy use of Google Maps in your Vue 3 projects.

Aug 16, 2022
Comments
  • 1. دریافت lat and long

    سلام امیدوارم که حالتون خوب باشه من از ریپازیتوری شما در حال استفاده هستم اما امکان دریافت لت و لانگ در ویو را ندارم . زمانی که از ویو مپ باکس استفاده میکنم و قسمت نمایش لت و لانگ مپ باکس جی ال به اسکریپت خودم اضافه میکنم نقشه فریز شده و امکان حرکت با ماوس به مناطق دیگر را ندارد و فقط یه محدوده مشخص را به صورت ثابت به من نمایش میدهد . آیا امکان دریافت لت و لانگ به صورت مستقیم در ویو سیدار در(ریپازیتوری شما ) وجود دارد ؟ لطفا نحوه ی استفاده از آن را توضیح دهید ،متاسفانه در داکیومنت همچین موردی را پیدا نکردم با تشکر

    Reviewed by morteza1399 at 2020-08-27 10:13
  • 2. problem in MglPopup

    I always get the following error, initiating a MglPopup. I've tried all these different objects but they don't work. Error: LngLatLike argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]

    here is my code :

    template:

     <MglPopup :coordinates="marker">
              <VCard>
                <div>help me please,</div>
              </VCard>
            </MglPopup>
    

    data: marker: [51.389, 35.6892] marker: { lng: "51.389", lat: "35.6892" },

    Reviewed by alisebt at 2020-08-04 05:33
Related tags
Web map Vue components with the power of OpenLayers

VueLayers Web map Vue components with the power of OpenLayers Overview VueLayers is components library that brings the powerful OpenLayers API to the

Aug 9, 2022
Web map Vue 3.x components with the power of OpenLayers
Web map Vue 3.x components with the power of OpenLayers

vue3-openlayers Web map Vue components with the power of OpenLayers Overview vue3-openlayers is components library that brings the powerful OpenLayers

Aug 17, 2022
A set of Vue.js components to display an interactive SVG map

vue-svg-map A set of Vue.js components to display an interactive SVG map. Demo Take a look at the live demo! Installation npm npm install --save vue-s

Jul 10, 2022
Choropleth Map component for Vue.js

vue-choropleth Vue components to display a choropleth map given a certain GeoJSON and another datasource to show information from. Using Vue2Leaflet H

Jul 11, 2022
vue google map custom marker component
vue google map custom marker component

vue2-gmap-custom-marker This component allows you to display custom HTML content on the map using Overlay. This component is an adaptation of the Goog

Aug 1, 2022
New Sayobot Map Downloader Written by [email protected], [email protected], [email protected]
New Sayobot Map Downloader Written by Electron@12, Vite@2, Vue@3

SayoDownloader This software only provide in Chinese! 一个全新设计的小夜地图下载器

Aug 8, 2022
A Vue JS component for displaying dynamic data on a world map.

This is no longer being maintained, please do not open issues or PRs. Vue World Map A Vue JS Component for displaying dynamic data on a world map. Map

May 10, 2022
A quick way to start a web map application with Vue.js using MapLibre GL JS.
A quick way to start a web map application with Vue.js using MapLibre GL JS.

Vue.js map using MapLibre GL JS A quick way to start a web map application with Vue.js using MapLibre GL JS. A simple fullscreen map application is us

May 28, 2022
Directus-extension-svgmap-picker-interface - Select a value from a SVG Map box, built using vue.js
Directus-extension-svgmap-picker-interface - Select a value from a SVG Map box, built using vue.js

This extension is under development, it may take breaking changes. SVG Map Picke

Jun 13, 2022
EV Charge Map is an application to search for all the EV charge points for your journey. Made with Quasar/Vue
EV Charge Map is an application to search for all the EV charge points for your journey. Made with Quasar/Vue

EV Charge Map is an application to search for all the EV charge points for your journey. Made with Quasar/Vue

Aug 3, 2022