Skip to content
Advertisement

Tag: leaflet

Missing data in JSON from API call, gives error

I make an API call to server to fetch data Then I turn the JSON into GeoJSON for Leaflet.js The problem is that every items does not have the values of “openingHours”. This makes the error “undefined” and I can’t retrieve data to display on Leaflet map. How can I go pass or ignore those values or perhaps filter them

Remove clicked marker Leaflet

I want to create an interactive map in html/js with Leaflet. I have a function that creates markers on click : Now, I want to remove markers when I click on them. However, I cannot find the way to do that. Is there a way to fetch marker id and remove it with a specific method ? Answer You need

Leaflet Change the circle radius in real time

I would like to change the size of the circle when selecting a value in the dropdown menu. I can change the size of the circle by pressing enter again in the search bar but I want to do it automaticaly when selecting a new value. I thought about emulate the enter key (folowing this : jquery (or pure js)

React Leaflet Bound not working as expected

I’m using react-leaflet package to create bound animation on the map from selected markers as seen on the screenshot below. Here is the full code: https://codesandbox.io/s/react-leaflet-marker-with-bound-869mj The map will be bound if only the selected markers change. I try to implement the bound animation sample code from the documentation here https://react-leaflet.js.org/docs/example-view-bounds/ As we can see from the screenshot above, the

Advertisement