Skip to content

Commit

Permalink
fix issue with maps icon when running in production mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Gilles committed Feb 8, 2017
1 parent cd5ed0a commit 80e61e5
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion assets/js/app/maps/maps.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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();
});

Expand Down

0 comments on commit 80e61e5

Please sign in to comment.