refs #2 make marker style option change directly effective
parent
bfe39ad302
commit
840406a82e
|
@ -611,38 +611,50 @@ function addTileServer(){
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// affects future markers and also existing ones
|
||||||
function updateLeafletDrawMarkerStyle(){
|
function updateLeafletDrawMarkerStyle(){
|
||||||
var wst = $('#markerstyleselect').val();
|
var wst = $('#markerstyleselect').val();
|
||||||
|
var theicon;
|
||||||
if (wst === 'tp' || wst === 'p'){
|
if (wst === 'tp' || wst === 'p'){
|
||||||
gpxedit.drawControl.setDrawingOptions({
|
theicon = L.divIcon({
|
||||||
marker: {
|
className: 'leaflet-div-icon2',
|
||||||
icon: L.divIcon({
|
iconAnchor: [5, 30]
|
||||||
className: 'leaflet-div-icon2',
|
|
||||||
iconAnchor: [5, 30]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if (wst === 'ts' || wst === 's'){
|
else if (wst === 'ts' || wst === 's'){
|
||||||
gpxedit.drawControl.setDrawingOptions({
|
theicon = L.divIcon({
|
||||||
marker: {
|
iconSize:L.point(6,6),
|
||||||
icon: L.divIcon({
|
html:'<div></div>'
|
||||||
iconSize:L.point(6,6),
|
|
||||||
html:'<div></div>'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if (wst === 'tm' || wst === 'm'){
|
else if (wst === 'tm' || wst === 'm'){
|
||||||
gpxedit.drawControl.setDrawingOptions({
|
theicon = L.divIcon({
|
||||||
marker: {
|
className: 'leaflet-marker-blue',
|
||||||
icon: L.divIcon({
|
iconAnchor: [12, 41]
|
||||||
className: 'leaflet-marker-blue',
|
|
||||||
iconAnchor: [12, 41]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gpxedit.drawControl.setDrawingOptions({
|
||||||
|
marker: {
|
||||||
|
icon: theicon
|
||||||
|
}
|
||||||
|
});
|
||||||
|
gpxedit.editableLayers.eachLayer(function(layer){
|
||||||
|
var id = layer.gpxedit_id;
|
||||||
|
var name = gpxedit.layersData[id].name;
|
||||||
|
if (layer.type === 'marker'){
|
||||||
|
layer.setIcon(theicon);
|
||||||
|
}
|
||||||
|
if (name !== ''){
|
||||||
|
layer.unbindTooltip();
|
||||||
|
if (wst === 'tm' || wst === 'tp' || wst === 'ts'){
|
||||||
|
layer.bindTooltip(name, {permanent:true});
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
layer.bindTooltip(name, {sticky:true});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
Loading…
Reference in New Issue