@h21-map/yandex-drawing-manager
Advanced tools
Comparing version 2.0.4 to 2.0.5
37
index.js
@@ -100,3 +100,3 @@ function DrawingManager(map, opts) { | ||
var createCenterMarker = (e) => { | ||
let isIconSelected = false; | ||
me._removeArea(); | ||
@@ -141,2 +141,18 @@ me._removeCenterMarker(); | ||
me._centerMarker.events.add('click', (event) => { | ||
if (!me.circle) { | ||
me.map.events.fire('draw:marker_click', me._getPosition()); | ||
if (!isIconSelected) { | ||
me._setIconMarker(me.markerOptions.iconUrlSelected); | ||
isIconSelected = true; | ||
} | ||
if (event && event.stopPropagation) { | ||
event.stopPropagation(); | ||
} else { | ||
window.event.cancelBubble = true; | ||
} | ||
} | ||
}) | ||
@@ -204,2 +220,3 @@ me.position = null; | ||
me._setIconMarker(me.markerOptions.iconUrl); | ||
me._centerMarkerAddEventListener(); | ||
@@ -307,5 +324,16 @@ me._createVertexMarker(); | ||
}; | ||
DrawingManager.prototype._setIconMarker = function (iconUrl) { | ||
let me = this; | ||
if (me._centerMarker) { | ||
me._centerMarker.options.set({ | ||
iconImageHref: iconUrl, | ||
iconImageSize: [24, 30], | ||
iconImageOffset: [-10, -24], | ||
}); | ||
} | ||
} | ||
DrawingManager.prototype._convertlatlngs = function () { | ||
@@ -666,7 +694,2 @@ | ||
me._centerMarker.events.add('click', () => { | ||
me.map.events.fire('draw:marker_click', me._getInfo()); | ||
}) | ||
}; | ||
@@ -673,0 +696,0 @@ |
{ | ||
"name": "@h21-map/yandex-drawing-manager", | ||
"scope":"@h21-map", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"description": "A library of Yandex Map JS API", | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25253
619