Add publishers & contributor maps #66

Merged
aadil merged 39 commits from feature/leaflet-map into main 2023-09-11 09:50:48 +00:00
Showing only changes of commit 99bea6ae6c - Show all commits

View File

@ -32,8 +32,23 @@
var end = L.GeoJSON.coordsToLatLng({{ .endPoint.location }}); var end = L.GeoJSON.coordsToLatLng({{ .endPoint.location }});
var startMarker = L.marker(start).addTo(map); var startMarker = L.marker(start).addTo(map);
startMarker.bindPopup({{ .startingPoint.name }});
var endMarker = L.marker(end).addTo(map); var endMarker = L.marker(end).addTo(map);
var route = L.polyline([start, end], {color: 'red'}).addTo(map); endMarker.bindPopup({{ .endPoint.name }});
var route = L.polyline([start, end], {color: '#000'}).addTo(map);
var productsString = "";
var productsList = {{ .products }};
productsList.forEach((product, i) => productsString = productsString + product.productTitle + (i + 1 < productsList.length ? ', ' : ""));
route.bindPopup(
'<p>Origin: <strong>' + {{ .startingPoint.name }} + '</strong><br />' +
'Destination: <strong>' + {{ .endPoint.name }} + '</strong><br />' +
'Courier: <strong>' + {{ .courier.name }} + '</strong><br />' +
'Products: <strong>' + productsString + '</strong><br />' +
'Status: <strong>' + {{ .status }} + '</strong></p>');
{{ end }} {{ end }}
{{ end }} {{ end }}