Skip to content

MeasureControl plugin scrolls map unwantedly #1737

Closed
@fcenzato

Description

@fcenzato

Describe the bug
When trying to measure a distance with MeasureControl plugin, every time I select a point on the map, the map automatically scrolls, resulting in the point being not in the location I want it to be. This way, the plugin can't be used. See attached video for an example.

To Reproduce
Create a map with the following code, and open the saved file in a browser (Chrome or Edge):

import folium
from folium.plugins import MeasureControl

base_map = folium.Map()
MeasureControl().add_to(base_map)
base_map.save(outfile="test_map.html")

Expected behavior
Whenever you click to add a mark on the map, that mark should be at the point you clicked, not at a random location from an unwanted scrolling of the map

Environment:

  • Browser: Edge and Chrome (same behaviour)
  • Jupyter Notebook or html files: same behaviour in both
  • Python version: 3.10.9
  • folium version: 0.14.0
  • branca version: 0.6.0

Possible solutions
As a workaround, I have downgraded folium to version 0.12.1, in which the plugin works correctly

test_map.html.-.Work.-.Microsoft.Edge.2023-03-14.09-33-34.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn issue describing unexpected or malicious behaviourpluginThis issue/PR is about an existing or new plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions