New answers tagged

1 vote
Accepted

Increasing size of chart inside pop-up window - Leaflet - d3.js?

It takes a bit of playing with browser debugger to find out what will make chart.js happy. The fact is that it modifies canvas attributes before drawing chart on it. To get desired results, relevant ...
TomazicM's user avatar
  • 24.1k
0 votes

Setting specific zooms when clicking on different circle markers from the same layer in Leaflet?

I found out the answer was pretty silly. I just wasn't passing map as a parameter in the function, but it's all good and working now. Sorry for the dumb question.
Zac's user avatar
  • 11
1 vote
Accepted

GeoJSON layer development

Exporting GeoJSON from uMap is explained here in the OpenStreetMap Wiki. (image source: OSM Wiki) Select "geojson" instead of "Full map data" in the download section. The simplest ...
winnewoerp's user avatar
  • 1,332
1 vote

Error when creating polygons with turf.js from existing GeoJSON polygon rings

When you create polygon from selected feature coordinates with turf.polygon function, you have to take into account that selected feature might be polygon or multipolygon. You have to check geometry ...
TomazicM's user avatar
  • 24.1k
1 vote
Accepted

Highlight polygon in Leaflet

To identify which polygon you want to select, you need to assign some id to polygon features: let data = { "type":"FeatureCollection", "features":[ { "...
TomazicM's user avatar
  • 24.1k
5 votes
Accepted

removeLayer or removeFrom(map) not working on betterwms layer from leaflet map

The problem in your code is that with var camadabairro = requestBairro(nomeBairro); you create a new layer every time check box is checked/unchecked. Solution is to put camadabairro layer variable at ...
TomazicM's user avatar
  • 24.1k
6 votes
Accepted

Control Layer Order/Z-Index of Custom DivIcon() Marker in Folium Map

Solution for your problem are Leaflet map panes (see https://leafletjs.com/reference.html#map-pane), which are DOM elements used to control the ordering of layers on the map. Each map pane has it's ...
TomazicM's user avatar
  • 24.1k
3 votes
Accepted

Binding id to each layer in Leaflet?

On way to bind id to each GeoJSON layer is to use onEachFeature option function, by adding to the layer some property that does no interfere with standard Leaflet layer properties. Relevant part of ...
TomazicM's user avatar
  • 24.1k
2 votes
Accepted

Use grouped layer control plugin with empty "dummy" layer groups that are only used to enable or disable filters for the GeoJSON layer

If you look at the answer to your previous question, the solution of which you used here, you added additional group level in your overlayMaps definition, so overlayMaps[evt.name].myId does not work ...
TomazicM's user avatar
  • 24.1k
1 vote
Accepted

Multiple on-the-fly filtering in the layers control based on markers' features properties on Leaflet

One possible solution is to create empty "dummy" layer groups which are used just to turn filters for GeoJSON layer on or off when selected/deselected in the layers control. Map overlayadd ...
TomazicM's user avatar
  • 24.1k
0 votes

No applicable method for 'metaData' applied to an object of class "NULL" with Leaflet map

I had that problem when using fillColor, and the way I solved it was using pal(cpop) instead of ~pal(cpop), not sure why though.
F506_CA's user avatar
1 vote

Leaflet plugin Leaflet-WMS.js Gives sometimes weird x-y coodinates

I edited Leaflet-WMS plugin code. I changed the request parameter URL from requestParamaters[version >= 1.3 ? 'i' : 'x'] = point.x; requestParamaters[version >= 1.3 ? 'j' : 'y'] = point.y; to: ...
jules2703's user avatar
1 vote
Accepted

Using marker drag event instead mouseover on each polygan layer in Leaflet?

Solution where you have to iterate over all GeoJSON polygons at each marker drag event can be quite costly when there is a big number of polygons. One possible solution to avoid this is using the ...
TomazicM's user avatar
  • 24.1k
0 votes

Using marker drag event instead mouseover on each polygan layer in Leaflet?

i solved it . i define marker drag event and get current latlng of marker. then i check in my geojson file for each polygan layer . i check if the new marker position falls within the layer. thank you ...
mrmiremad's user avatar
0 votes

Display route layer between current user location and geocoded search locaton in Leaflet?

To catch geocoder event when location is found you can use markgeocode geocoder control event. To prevent default geocoder action you can use defaultMarkGeocode: false option. To zoom on route found ...
TomazicM's user avatar
  • 24.1k

Top 50 recent answers are included