Skip to content

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 ignor…

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)