Skip to content

Commit

Permalink
add an additional event listener for markers
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeiown committed Apr 18, 2024
1 parent 7c1eb3d commit 2102f8b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions js/markers.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ export function addMarkers(map) {

const marker = L.marker([address.lat, address.lng], { icon: customIcon });
marker.bindPopup(`<b>${address.company}</b><br>${address.address}<br><small>${address.info}`);

marker.on('mouseover', function (e) {
this.openPopup();
});

markers.addLayer(marker);
});

Expand Down

0 comments on commit 2102f8b

Please sign in to comment.