Bergen88 Bergen88 - 1 year ago 160
Javascript Question

Polygon highlighting with Mapbox or Leaflet

I am trying to replicate polygon highlighting on mouseover event in mapbox.js or leaflet.js similar to the example below:

How does this work?

Answer Source

Using Leaflet, you simply have to define a function to set the style of the polygon on mouseover event. For example:

polygonLayer.on('mouseover', function (this) {
        fillOpacity: 0,
        color: 'black'
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download