jupyter-widgets / ipyleaflet

A Jupyter - Leaflet.js bridge
https://ipyleaflet.readthedocs.io
MIT License
1.48k stars 363 forks source link

Duplicated Measure Control Icon #1093

Open iacisme opened 1 year ago

iacisme commented 1 year ago

There's an issue with ipyleaflet where the measure control icon shows up twice, as shown in this image:

image

Here is the code I used:

import ipyleaflet

m = ipyleaflet.Map(basemap = ipyleaflet.basemap_to_tiles(ipyleaflet.basemaps.OpenStreetMap.Mapnik),
                   center = (48.204793, 350.121558),
                   zoom = 3
                  )

m.add_control(ipyleaflet.ScaleControl(position = 'bottomleft'))

measure = ipyleaflet.MeasureControl(position = 'topleft',
                                    active_color = 'green',
                                    completed_color = 'purple',
                                    primary_length_unit = 'kilometers',
                                   )

m.add_control(measure)

m

The icon related to the one I created is the bottom one. The top one is the duplicated one. The purple line is the line I created, the light green one is the duplicate one. The duplicated is also in an entirely different unit of measure.

ipyleaflet version = 0.17.0

I don't want to upgrade to a newer version of ipyleaflet because of issue #1076, which has affected me and caused me to downgrade to 0.17.0.

Can you please advise on a fix?

Thank you.