Skip to content

Commit a7695e9

Browse files
committed
Added support for specifying additional marker options
1 parent 68f26b6 commit a7695e9

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

dist/angular-leaflet-directive.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,7 @@
12591259
}
12601260
},
12611261
crs: L.CRS.EPSG3857,
1262-
tileLayer: 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
1262+
tileLayer: '//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
12631263
tileLayerOptions: { attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' },
12641264
path: {
12651265
weight: 10,
@@ -2496,6 +2496,12 @@
24962496
zIndexOffset: isDefined(markerData.zIndexOffset) ? markerData.zIndexOffset : 0,
24972497
iconAngle: isDefined(markerData.iconAngle) ? markerData.iconAngle : 0
24982498
};
2499+
// Add any other options not added above to markerOptions
2500+
for (var markerDatum in markerData) {
2501+
if (markerData.hasOwnProperty(markerDatum) && !markerOptions.hasOwnProperty(markerDatum)) {
2502+
markerOptions[markerDatum] = markerData[markerDatum];
2503+
}
2504+
}
24992505
return new L.marker(markerData, markerOptions);
25002506
},
25012507
addMarkerToGroup: function (marker, groupName, map) {

0 commit comments

Comments
 (0)