Closed TamaraVucic closed 2 years ago
Hm. Probably a bug. I will check it later. For the moment, you can solve te problem if you set icon in the same time when you create your marker:
var icon = L.icon({
iconUrl: iconUrl,
iconSize: [40,40]
});
L.marker([coordinates[1],coordinates[0]], {
icon: icon
});
It is possible to change icon of bouncing marker starting from version 3.0.1
.
Hello, thanks for your plugin, but I had problems using it. Exception that I got after including your script via CDN link:
Uncaught TypeError: Cannot read property 'style' of undefined at Function.ofMarker (bundle.js:391) at BouncingMotion3D.resetStyles (bundle.js:475) at i.setIcon (bundle.js:1316) at Object.success (map.js:122) at c (jquery.min.js:2) at Object.fireWith [as resolveWith] (jquery.min.js:2) at l (jquery.min.js:2) at XMLHttpRequest. (jquery.min.js:2)
My function where exception is thrown:
success: function(data) { var placeLayerGroups = dict['Place'];
var features = data.features;
for (i = 0; i < features.length; ++i) { var coordinates = features[i].geometry.coordinates; var marker = L.marker([coordinates[1],coordinates[0]]);// switch lat long marker.dbID = features[i].properties.pk; marker.name = features[i].properties.name; var layerGroup = placeLayerGroups[features[i].properties.placeType];
var iconName = layerGroup.name.replace("/", "_"); var iconUrl = iconFolder + "/place" + "/" + iconName + ".png";