Skip to content
Advertisement

Tag: leaflet

How do I edit the popups bound to a polygon object

Currently, wherever I click on the map a popup appears with the country’s name. The country is determined by a geoJSON file that has the names and multi-polygon lnglat coordinates that sets the borders for each country to save me entering each one individually. However, I want each popup bound to a leaflet polygon to display various amounts of information

Remove previous markers before update marker in leaflet map?

Here I am trying to update the markers on map upon successful ajax request but I am being unable to remove previously added markers before adding new one. How can I do it here ? Answer Here’s an example, that stores the Marker inside each location Object of your locations Array. Additionally, create two functions, drawLocationsToMap and removeLocationsFromMap.

Use lasso instead Rectangle for select reign in Leaflet

I am trying to show a leaflet map using R(I can not use Shiny package). I use a ‘DT’, ‘crosstalk’ and ‘leaflet’ packages to calculate the mean of a column for selected data in map. In the map, it select the points only by Rectangle shape. Is it possible to select by lasso ? I found leaflet-lasso(Lasso selection plugin (Demo),Jan

Download shapes from leaflet map

I have online access to a leaflet map, but cannot reach the authors. Is there a way to download shapes from this map (to shp, geojson, etc.)? I thought of running some leaflet-related javascript code in browser console, but I couldn’t find any relevant commands in the documentation. Answer When you look into the dev tools of the link you

Leaflet controls not responding to click

Not sure how I have managed this but my leaflet zoom controls are not clickable? They do show up on the screen but there is no mouse change when hovering over them. Do I need to create another layer for the controls or am I missing something else from my code? update: The map will also not scroll or zoom

How to generate markers from an api in leaflet?

I’m making in app using vue and leaflet and I need to generate markers from and API. But for some reason, only the default markers are showing. I can access the api data in the DOM. I just can’t figure out how to iterate over it and show the data on the DOM. pls help here’s the code Answer You

Advertisement