Hot answers tagged

4 votes
Accepted

What's wrong with this geojson file?

A valid GeoJSON is only in EPSG:4326. Your file is in EPSG:25830. You can set the CRS when you export the file in QGIS.
  • 8,388
1 vote

Leaflet symbology using jQuery with a static api response

On possible solution to quickly change style of features would be: first read AJAX data and upon completion create vector layer rdNetworkLyr and within onEachFeature function assign secondary color ...
  • 18.4k
1 vote
Accepted

The Leaftlet `Multiverse` issue

There are some options mentioned in the options for the Map object. Set maxBounds with a longitude range of -180, 180 maxBoundsViscosity can be used to control the behaviour of panning at the edges ...
1 vote

How can I use OpenTopoMap Garmin Maps files with Leaflet?

You could use your own local tile server. Here is a complete walk-through how to set up a OpenTopoMap tile server: https://github.com/der-stefan/OpenTopoMap/blob/master/mapnik/README.md You could ...
  • 1,475
1 vote
Accepted

Leaflet geoJSON "setStyle" function for multiple styles

This problem is not really GIS related, but purely JS related one, but anyway ... When you try to iterate over object keys and get their values, you are always using the whole object res.XDSegID in ...
  • 18.4k
1 vote
Accepted

Overwriting Filtered GeoJSON layer on Leaflet map based on user selection

One possible solution is to introduce global variable filteredLayer where you store current filtered overlay and so can remove it when new one is created and added to the map. There's also error in ...
  • 18.4k
1 vote
Accepted

Filtering GeoJSON layer on Leaflet map based on date selected by user

There are several things wrong the way you are handling date data, so this is not really GIS related question but completely JS related one, but anyway ... In comparison you are using expression Date(...
  • 18.4k
1 vote

Highlight city, town, village or hamlet name in Leaflet

What you can do is query nominatim when the mouse hasn't moved after x seconds. For displaying it without out a pin / marker you can use a plain popup. In the example I am making the query if the ...
  • 1,215
1 vote
Accepted

Adding custom labels to Leaflet map

This is really basic HTML/JS question and should be asked on StackOverflow, but anyway ... Instead of adding same text to every legend element you have to add appropriate text only to the first and ...
  • 18.4k
1 vote

Leaflet.Control.Minimap does not show toggle icon

According to https://github.com/Norkart/Leaflet-MiniMap and https://www.npmjs.com/package/leaflet-minimap To use this plugin, you have to include in your index.html: <script type="module" ...
1 vote

Is it possible to use a raster::click event within an interactive leaflet map?

The following example (using package leafem version 0.1.3) looks to be the simplest solution I can find: library(dplyr) library(leaflet) library(leafem) library(raster) #example raster r <- ...
  • 46
1 vote

Make Leaflet map background transparent

This worked for me, .leaflet-container { background: none !important; }

Only top scored, non community-wiki answers of a minimum length are eligible