Search code examples
ngx-leaflet

Is it possible to add a label to a leaflet.circle?


This works, and places a circle on the map

layers = [circle([ 46.95, -122 ], { radius: 5000 })];

Are there any controls (or trix) in ngx-leaflet that would let me do something like this?

layers = [circle([ 46.95, -122 ], { radius: 5000, label:'my label' })];

the same way that https://github.com/w8r/leaflet-labeled-circle works.

Or - how should I use the leaflet-labelede-circle together with ngx-leaflet?


Solution

  • You would need to include the leaflet-labeled-circle plugin into your project and ensure it is loaded with Leaflet when you create your layers.

    You can see examples of loading third party libraries here: https://github.com/Asymmetrik/ngx-leaflet-tutorial-plugins