Change icons for the hub map. #270

This commit is contained in:
Korina Cordero 2019-12-09 08:08:17 +00:00
parent bf2231037d
commit fdf6861819

View file

@ -1042,13 +1042,23 @@ $(function() {
var destLayerGroup = L.layerGroup().addTo(hmap);
var hubLayerGroup = L.layerGroup().addTo(hmap);
var dest_marker = new L.Marker([hub_lat, hub_lng]).bindPopup("Destination");
var dest_icon = L.icon({
iconUrl: '/assets/images/icon-destination.png',
shadowSize: [0,0]
});
var hub_icon = L.icon({
iconUrl: '/assets/images/icon-outlet.png',
shadowSize: [0,0]
});
var dest_marker = new L.Marker([hub_lat, hub_lng], {icon: dest_icon}).bindPopup("Destination");
destLayerGroup.addLayer(dest_marker);
{% for hub in hubs %}
var hub_marker = new L.Marker([{{ hub.hub.getCoordinates.getLatitude }},
{{ hub.hub.getCoordinates.getLongitude }}]).bindPopup("{{ hub.hub.getName }}");
{{ hub.hub.getCoordinates.getLongitude }}], {icon: hub_icon}).bindPopup("{{ hub.hub.getName }}");
hubLayerGroup.addLayer(hub_marker);
{% endfor %}