Perspective Map: make areas (polygons) hoverable & clickable?

Is it possible to make map polygons hoverable and clickable by the user? I want to create polygons that define areas on a map, and have the user be able to hover over the areas and have them change style, and also be able to click to go to that area.

3 Likes

Looks like this has been added :smiley:

Hi, apologies for replying to an old post.

Yes they did add an onVectorClick event, but so many other features, that markers have, are not available for Vectors.

Markers have a popup and view property which vectors don't have.

I want to be able to hover over a vector and get a popup so that people know what area they are looking at. I can't use the click event since that is for zooming in on the area.

Just curious if you were able to make this work?

I have the same question. I spent several hours trying to run a script on a geoJSON file for adding a tooltip and popup attributes to type: Feature….. type: Polygon, only to realize it wouldn’t work. Is this a function not supported by leaflet?

Anyone managed to crate event on hover ?
I can't figure out how to do :disappointed_relieved: