Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-yandex-maps

Package Overview
Dependencies
Maintainers
1
Versions
159
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-yandex-maps

Yandex Maps component for VueJS.

  • 0.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
14K
increased by6.42%
Maintainers
1
Weekly downloads
 
Created
Source

vue-yandex-maps

vue-yandex-maps is a plugin for vue.js that adds yandex-map custom element.

Install

npm install vue-yandex-maps --save

CommonJS

You can use any build tool which supports commonjs:

// register globally
const YmapPlugin =  require('vue-yandex-maps');
Vue.use(YmapPlugin)

// or for a single instance
const { yandexMap, ymapMarker } = require('vue-yandex-maps');
new Vue({
  components: { yandexMap, ymapMarker }
})

Or in ES2015:

// register globally
import YmapPlugin from 'vue-yandex-maps'
Vue.use(YmapPlugin)

// or for a single instance
import { yandexMap, ymapMarker } from 'vue-yandex-maps'
new Vue({
  components: { yandexMap, ymapMarker }
})

Usage

Use <yandex-map> tag to enable the map instance and use attributes to define map options. Use <ymap-marker> tag to enable the instance of map-marker. Type of marker in marker-type attribute can be:

  • Placemark
  • Polyline
  • Rectangle
  • Polygon
  • Circle
<yandex-map 
  :coords="[54.62896654088406, 39.731893822753904]"
  zoom="10"
  style="width: 600px; height: 600px;"
  :cluster-options="{
    1: {clusterDisableClickZoom: true}
  }"
  :behaviors="['ruler']"
  :controls="['trafficControl']"
  map-type="hybrid"
>

    <ymap-marker 
      marker-type="placemark"
      :coords="[54.7, 39.7]"
      hint-content="Hint content 1"
      :balloon="{header: 'header', body: 'body', footer: 'footer'}"
      :icon="{color: 'green', glyph: 'cinema'}"
      cluster-name="1"
    ></ymap-marker>

    <ymap-marker 
      marker-type="placemark"
      :coords="[54.6, 39.8]"
      hint-content="Hint content 1"
      :balloon="{header: 'header', body: 'body', footer: 'footer'}"
      :icon="{color: 'green', glyph: 'cinema'}"
      cluster-name="1"
    ></ymap-marker>

    <ymap-marker 
      marker-type="circle"
      :coords="[54.62896654088406, 39.731893822753904]"
      circle-radius="1600"
      hint-content="Hint content 1"
      :marker-fill="{color: '#000000', opacity: 0.4}"
      :marker-stroke="{color: '#ff0000', width: 5}"
      :balloon="{header: 'header', body: 'body', footer: 'footer'}"
    ></ymap-marker>

</yandex-map>

Attributes

Map attributes

AttributeTypeDescription
coordsArray [ latitude, longtitude ]Coordinates of map center. Required
zoomNumberZoom of map (from 0 to 19). Default value is 18.
cluster-optionsObjectMap, where key is a name of cluster and value is an object of cluster options. Cluster option
behaviorsArrayArray of enabled map behaviors. All another will be disabled. Behaviors
controlsArrayArray of enabled map controls. All another will be disabled. Controls
map-typeStringMap type. Possible types: map, satellite, hybrid. Default value is map.

Marker attributes

AttributeTypeDescriptionMarker-types
marker-typeStringType of marker
coordsArray [ latitude, longtitude ]Coordinates of point or circle center. RequiredPlacemark, Circle
coordsArray of arrays [ [latitude, longtitude], [...] ]Coordinates of shape corners. RequiredRectangle, Polyline
coordsArray of two arrays of coordinates arrays (first for outer contour, second for inner) [ [[latitude, longtitude], [...]], [[...], [...]] ]Coordinates of shape corners. RequiredPolygon
hint-contentStringTooltip contentAll
balloonObjectBalloon content object with three properties: header, body, footerAll
iconObjectIcon object with three properties: color (default value is 'blue'), content, glyph. Glyph property have higher priority than content. List of colors and iconsPlacemark
marker-fillObjectFill properties object with two properties: enabled, color, opacityPolygon, Rectangle, Circle
marker-strokeObjectStroke properties object with four properties: color, opacity, width, stylePolygon, Rectangle, Circle, Polyline
circle-radiusNumberRadius of circle in meters. Default value is 1000.Circle
cluster-nameStringAttribute for grouping markers in clustersAll

License

MIT

Keywords

FAQs

Package last updated on 19 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc