Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /Init the map.
- map = DG.map('map', {
- center: [54.98, 73.385],
- zoom: 14,
- fullscreenControl: false,
- zoomControl: false,
- doubleClickZoom: false
- });
- //Get all coordinates and names of locations and render them on the map.
- $.getJSON("http://api.lara.dev/locations/", function(data) {
- $.each(data, function(key, val) {
- var geo = val.coordinates,
- name = val.name,
- id = val.id;
- geo = geo.replace(/[\[\]]/g, '').split(',');
- var marker = DG.marker(geo, {
- }).addTo(map).bindPopup(name);
- marker.on('click', function() {
- window.location.href = "http://lara.dev/#/locations/" + id;
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement