[draw-tools] set new color properly
This change sets the new color on the cached options before passing them to the DrawControl. Otherwise, bookmark's auto-draw feature would use the wrong color
This commit is contained in:
parent
aad6f3cd70
commit
c19106fd34
@ -93,11 +93,15 @@ window.plugin.drawTools.setDrawColor = function(color) {
|
|||||||
window.plugin.drawTools.currentColor = color;
|
window.plugin.drawTools.currentColor = color;
|
||||||
window.plugin.drawTools.currentMarker = window.plugin.drawTools.getMarkerIcon(color);
|
window.plugin.drawTools.currentMarker = window.plugin.drawTools.getMarkerIcon(color);
|
||||||
|
|
||||||
window.plugin.drawTools.drawControl.setDrawingOptions({
|
window.plugin.drawTools.lineOptions.color = color;
|
||||||
'polygon': { 'shapeOptions': { color: color } },
|
window.plugin.drawTools.polygonOptions.color = color;
|
||||||
'polyline': { 'shapeOptions': { color: color } },
|
window.plugin.drawTools.markerOptions.icon = window.plugin.drawTools.currentMarker;
|
||||||
'circle': { 'shapeOptions': { color: color } },
|
|
||||||
'marker': { 'icon': window.plugin.drawTools.currentMarker },
|
plugin.drawTools.drawControl.setDrawingOptions({
|
||||||
|
polygon: { shapeOptions: plugin.drawTools.polygonOptions },
|
||||||
|
polyline: { shapeOptions: plugin.drawTools.lineOptions },
|
||||||
|
circle: { shapeOptions: plugin.drawTools.polygonOptions },
|
||||||
|
marker: { icon: plugin.drawTools.markerOptions.icon },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user