Skip to content
This repository was archived by the owner on Sep 20, 2019. It is now read-only.

Commit 8bd4509

Browse files
author
Valentin Hervieu
committed
fix(Markers): fix marker icon broken with latest Leaflet version (1.0)
Leaflet now tries to auto-detect the path for the icons, but when using a base64 one, it breaks. Thus, we need to force the imagePath to be ' '. See this line in Leaflet source: https://github.com/Leaflet/Leaflet/blob/master/src/layer/marker/Icon.Default.js#L36
1 parent 31e6f28 commit 8bd4509

File tree

6 files changed

+26
-23
lines changed

6 files changed

+26
-23
lines changed

dist/ui-leaflet.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* ui-leaflet 1.0.0 2016-09-27
2+
* ui-leaflet 1.0.0 2016-09-28
33
* ui-leaflet - An AngularJS directive to easily interact with Leaflet maps
44
* git: https://github.com/angular-ui/ui-leaflet
55
*/
@@ -2093,6 +2093,7 @@ angular.module('ui-leaflet').service('leafletMarkersHelpers', ["$rootScope", "$t
20932093
return new L.Icon.Default({
20942094
iconUrl: base64icon,
20952095
shadowUrl: base64shadow,
2096+
imagePath: ' ',
20962097
iconSize: [25, 41],
20972098
iconAnchor: [12, 41],
20982099
popupAnchor: [1, -34],
@@ -4252,12 +4253,12 @@ angular.module('ui-leaflet').directive('markers', ["leafletLogger", "$rootScope"
42524253
var pass = _maybeAddMarkerToLayer(layerName, layers, model, marker, watchOptions.individual.type, map);
42534254
if (!pass) return; //something went wrong move on in the loop
42544255
} else if (!isDefined(model.group)) {
4255-
// We do not have a layer attr, so the marker goes to the map layer
4256-
map.addLayer(marker);
4257-
if (watchOptions.individual.type === null && model.focus === true) {
4258-
marker.openPopup();
4256+
// We do not have a layer attr, so the marker goes to the map layer
4257+
map.addLayer(marker);
4258+
if (watchOptions.individual.type === null && model.focus === true) {
4259+
marker.openPopup();
4260+
}
42594261
}
4260-
}
42614262

42624263
if (watchOptions.individual.type !== null) {
42634264
addMarkerWatcher(marker, pathToMarker, leafletScope, layers, map, watchOptions.individual);
@@ -5067,7 +5068,7 @@ angular.module('ui-leaflet').factory('leafletMarkerEvents', ["$rootScope", "$q",
50675068

50685069
'use strict';
50695070

5070-
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
5071+
function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; }
50715072

50725073
angular.module('ui-leaflet').factory('leafletPathEvents', ["$rootScope", "$q", "leafletLogger", "leafletHelpers", "leafletLabelEvents", "leafletEventsHelpers", function ($rootScope, $q, leafletLogger, leafletHelpers, leafletLabelEvents, leafletEventsHelpers) {
50735074
var isDefined = leafletHelpers.isDefined,

dist/ui-leaflet.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ui-leaflet.min.no-header.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ui-leaflet_dev_mapped.js

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ui-leaflet_dev_mapped.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/services/leafletMarkersHelpers.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ angular.module('ui-leaflet').service('leafletMarkersHelpers', function ($rootSco
9898
return new L.Icon.Default({
9999
iconUrl: base64icon,
100100
shadowUrl: base64shadow,
101+
imagePath: ' ',
101102
iconSize: [25, 41],
102103
iconAnchor: [12, 41],
103104
popupAnchor: [1, -34],

0 commit comments

Comments
 (0)