added mousehovers for marker popups
This commit is contained in:
parent
eaf9ba8399
commit
ec91384e9a
1 changed files with 9 additions and 3 deletions
|
@ -66,9 +66,15 @@
|
|||
lat = data.features[0].geometry.coordinates[1];
|
||||
lon = data.features[0].geometry.coordinates[0];
|
||||
|
||||
L.marker([lat, lon], {icon: marker_icon}).addTo(map)
|
||||
.bindPopup(location.name + ', ' + location.address)
|
||||
.openPopup();
|
||||
let marker = L.marker([lat, lon], {icon: marker_icon}).addTo(map)
|
||||
.bindPopup(location.name + ', ' + location.address);
|
||||
|
||||
marker.on('mouseover', function(env) {
|
||||
marker.openPopup();
|
||||
});
|
||||
marker.on('mouseout', function(env){
|
||||
marker.closePopup();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue