-
-
Save anonymous/171203a580e65ed975b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var point_list = L.Polyline.fromEncoded(_encoded).addTo(map); | |
route_lines = [L.polyline(point_list)], | |
markers = []; | |
$.each(route_lines, function(i, route_line) { | |
var animated_marker = L.animatedMarker(route_line.getLatLngs(), { | |
icon: walk_icon, | |
distance: 50, | |
interval: 5000, | |
autoStart: false, | |
}); | |
function pan_map(){ | |
map.panTo({ lat: animated_marker['_latlng'].lat, lon: animated_marker['_latlng'].lng }); | |
} | |
pan_map(); | |
var f_interval = setInterval(function() { | |
if (_flag == 1) { | |
animated_marker.stop(); | |
clearInterval(f_interval); | |
} | |
pan_map(); | |
}, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment