Skip to content

Commit

Permalink
markerId is now required prop
Browse files Browse the repository at this point in the history
  • Loading branch information
PNKBizz committed Feb 7, 2018
1 parent 0b0347b commit e7aa0f2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ Use `<yandex-map>` tag to enable the map instance and use attributes to define m
If you have a lot of markers on your map i strongly recommend you to use map attribute `useObjectManager`. But in this case you can't set callbacks to your markers through marker attribute `callbacks`.

You may define placemarks on your map by using `<ymap-marker>` tag or set an array of objects with placemark options through `<yandex-map>` attribute `placemarks` ([interface description](https://tech.yandex.ru/maps/doc/jsapi/2.0/ref/reference/GeoObject-docpage/)). You also can use both methods together.<br>
The Map instance rerender when changed array with markers in `placemarks` property or marker properties if marker is a component.<br>
You must define `markerId` for every marker on your map in any case fo setting (through map attribute `placemarks` or using `ymap-marker` components).<br>
The Map instance rerender when changed array with markers or marker properties if marker is a component.<br>
Also map watch property `coords` and react without rerender, when it changed.

Type of marker in `marker-type` attribute can be:
Expand Down Expand Up @@ -165,6 +166,7 @@ data() {

| Attribute | Type | Description | Marker-types |
| ----- | ----- | ----- | ----- |
| marker-id | String, Number | Marker Id. Required ||
| marker-type | String | Type of marker ||
| coords | Array [ latitude, longtitude ] | Coordinates of point or circle center. Required | Placemark, Circle |
| coords | Array of arrays [ [latitude, longtitude], [...] ] | Coordinates of shape corners. Required | Rectangle, Polyline |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-yandex-maps",
"version": "0.7.0",
"version": "0.7.1",
"description": "Yandex Maps component for VueJS.",
"main": "vue-yandex-maps.js",
"jsnext:main": "./src/index.js",
Expand Down
5 changes: 4 additions & 1 deletion src/Marker.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ export default {
callbacks: Object,
data: Object,
balloonTemplate: String,
markerId: [String, Number]
markerId: {
type: [String, Number],
required: true
}
},
render() {
},
Expand Down

0 comments on commit e7aa0f2

Please sign in to comment.