Fix some bugs regarding OMS by introducing a new helper function
This commit is contained in:
@ -258,10 +258,7 @@ window.plugin.drawTools.import = function(data) {
|
||||
var extraMarkerOpt = {};
|
||||
if (item.color) extraMarkerOpt.icon = window.plugin.drawTools.getMarkerIcon(item.color);
|
||||
layer = L.marker(item.latLng, L.extend({},window.plugin.drawTools.markerOptions,extraMarkerOpt));
|
||||
window.oms.addMarker(layer);
|
||||
layer.on('remove', function() {
|
||||
window.oms.removeMarker(layer);
|
||||
});
|
||||
window.registerMarkerForOMS(layer);
|
||||
break;
|
||||
default:
|
||||
console.warn('unknown layer type "'+item.type+'" when loading draw tools layer');
|
||||
@ -431,10 +428,7 @@ window.plugin.drawTools.boot = function() {
|
||||
window.plugin.drawTools.save();
|
||||
|
||||
if(layer instanceof L.Marker) {
|
||||
window.oms.addMarker(layer);
|
||||
layer.on('remove', function() {
|
||||
window.oms.removeMarker(layer);
|
||||
});
|
||||
window.registerMarkerForOMS(layer);
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user