0

According to react leaflet documentation below code must work. Or am I doing any wrong? A suggestion would be appreciated. Thanks in advance

   <WMSTileLayer
          layers={ 'banbeis:division' }
          url={ `http://localhost:8080/geoserver/banbeis/wms` }
          maxZoom={ 18 }
          transparent={ true }
          format='image/png'
          opacity={ 0.5 }
          eventHandlers={ {
            click: () =>
                    {
                    console.log( 'layer clicked' ); <--------- does not work
                    },
                } }
            />
Amir
  • 8,821
  • 7
  • 44
  • 48

1 Answers1

0

WMS tilelayers don't handle click events, or any other mouse/touch/pointer events, as per https://leafletjs.com/reference.html#tilelayer-wms

IvanSanchez
  • 18,272
  • 3
  • 30
  • 45