From 80e61e574d4aa9802913e0e8bd7b8831db786c42 Mon Sep 17 00:00:00 2001 From: Pierre-Gilles Leymarie Date: Wed, 8 Feb 2017 08:56:59 +0100 Subject: [PATCH] fix issue with maps icon when running in production mode --- assets/js/app/maps/maps.controller.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/assets/js/app/maps/maps.controller.js b/assets/js/app/maps/maps.controller.js index 6ff9f2f366..b775539053 100644 --- a/assets/js/app/maps/maps.controller.js +++ b/assets/js/app/maps/maps.controller.js @@ -25,6 +25,17 @@ getPoints(); + var icon = L.icon({ + iconUrl: '/styles/leaflet/images/marker-icon.png', + iconRetinaUrl: '/styles/leaflet/images/marker-icon-2x.png', + shadowUrl: '/styles/leaflet/images/marker-shadow.png', + iconSize:[25,41], + iconAnchor:[12,41], + popupAnchor:[1,-34], + tooltipAnchor:[16,-28], + shadowSize:[41,41] + }); + function getPoints(){ geoLocationService.get() .then(function(data) { @@ -38,7 +49,7 @@ } vm.locations.forEach(function(location){ - markerUser[location.user] = L.marker([location.latitude, location.longitude]).addTo(leafletMap); + markerUser[location.user] = L.marker([location.latitude, location.longitude], {icon: icon}).addTo(leafletMap); markerUser[location.user].bindTooltip(location.firstname + ' ' + location.lastname).openTooltip(); });