mobile - show-user-location
1. if canvas-based layers are in use, don't draw the hack range marker (as any leaflet path-based drawing is slow, and they don't support SVG styles) 2. only add/remove the circle marker layer when needed - as the leaflet library doesn't document what will happen if a removed layer is removed again, or an added layer is added again
This commit is contained in:
parent
ffc056505f
commit
427614ccca
@ -66,10 +66,13 @@ window.plugin.userLocation.setup = function() {
|
||||
};
|
||||
|
||||
window.plugin.userLocation.onZoomEnd = function() {
|
||||
if(window.map.getZoom() < 16)
|
||||
window.plugin.userLocation.locationLayer.removeLayer(window.plugin.userLocation.circle);
|
||||
else
|
||||
window.plugin.userLocation.locationLayer.addLayer(window.plugin.userLocation.circle);
|
||||
if(window.map.getZoom() < 16 || L.Path.CANVAS) {
|
||||
if (window.plugin.userLocation.locationLayer.hasLayer(window.plugin.userLocation.circle))
|
||||
window.plugin.userLocation.locationLayer.removeLayer(window.plugin.userLocation.circle);
|
||||
} else {
|
||||
if (!window.plugin.userLocation.locationLayer.hasLayer(window.plugin.userLocation.circle))
|
||||
window.plugin.userLocation.locationLayer.addLayer(window.plugin.userLocation.circle);
|
||||
}
|
||||
};
|
||||
|
||||
window.plugin.userLocation.locate = function(lat, lng, accuracy) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user