MCPcopy Create free account
hub / github.com/python-visualization/folium / LatLngPopup

Class LatLngPopup

folium/features.py:1775–1800  ·  view source on GitHub ↗

When one clicks on a Map that contains a LatLngPopup, a popup is shown that displays the latitude and longitude of the pointer.

Source from the content-addressed store, hash-verified

1773
1774
1775class LatLngPopup(MacroElement):
1776 """
1777 When one clicks on a Map that contains a LatLngPopup,
1778 a popup is shown that displays the latitude and longitude of the pointer.
1779
1780 """
1781
1782 _template = Template(
1783 """
1784 {% macro script(this, kwargs) %}
1785 var {{this.get_name()}} = L.popup();
1786 function latLngPop(e) {
1787 {{this.get_name()}}
1788 .setLatLng(e.latlng)
1789 .setContent("Latitude: " + e.latlng.lat.toFixed(4) +
1790 "<br>Longitude: " + e.latlng.lng.toFixed(4))
1791 .openOn({{this._parent.get_name()}});
1792 }
1793 {{this._parent.get_name()}}.on('click', latLngPop);
1794 {% endmacro %}
1795 """
1796 ) # noqa
1797
1798 def __init__(self):
1799 super().__init__()
1800 self._name = "LatLngPopup"
1801
1802
1803class ClickForMarker(MacroElement):

Callers

nothing calls this directly

Calls 1

TemplateClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…