Hot answers tagged

4 votes
Accepted

Crossing lines when displaying multilinestring from GeoJSON in Leaflet

I managed to partly resolve the mystery of GeoJSON returned by WFS service. There are still some coordinates missing, but that's probably consequence of some configuration error on GeoServer. First I ...
  • 20.3k
4 votes
Accepted

Polygon fill pattern not visible in screenshot taken with Leaflet simpleMapScreenshoter plugin

Screen shooting part of leaflet-simple-map-screenshoter plugin is based on dom-to-image-more library (see https://github.com/1904labs/dom-to-image-more). If you look at the plugin docs, you can find ...
  • 20.3k
4 votes
Accepted

Specify tilelayer position on Leaflet

Build a VRT tileset and use that as input to gdal2tiles. That way you get a single tiletree that is a mosaic of your source images. My data: I cut a USGS topo map into 3 PNG files, 1.png, 2.png and 3....
  • 4,439
4 votes
Accepted

Create a toggle for users to place markers in Leaflet?

For creating toggle button control you can use L.EasyButton Leaflet plugin (see https://github.com/CliffCloud/Leaflet.EasyButton). To differentiate between toggle states you can for example set button ...
  • 20.3k
4 votes
Accepted

Leaflet.js transfer information of a point: latitude, longitude, feature properties and variables, to a function

I was able to fix it adding a class: on("popupopen", after bindPopup var featureLayer_hebergement = new L.GeoJSON( null, { // style: styled(color= 'Peru', fillColor = 'Peru'), ...
3 votes

Offset of markers and polygon depending on zoom level in Leaflet

This is not really an answer, it's just that comments with pictures are not possible. I could not replicate described behavior in plain JS Leaflet. This is the map I got: There is still some offset, ...
  • 20.3k
2 votes

Displaying flatgeobuf file in Leaflet

This is nor really a GIS question, but completely JS related one, but anyway ... If you look at the browser debugger console, you should see an error like: Uncaught SyntaxError: await is only valid ...
  • 20.3k
2 votes

GeoJSON from SQL View

You seem to have a logical misconception in your approach, leading to the syntax issue: you are sending a FeatureCollection to the server to eventually get passed into the query - however, ...
  • 26.9k
2 votes

Shift in Raster image in R Leaflet

I think this is related to problems with PROJ4 strings, and hence the move to WKT projection strings in modern PROJ systems. The quick fix is to reset the projection to epsg:27700 via a CRS call: > ...
  • 57.9k
1 vote

Offset of markers and polygon depending on zoom level in Leaflet

Found the issue. It was indeed in CSS. I had a margin 10 on all divs. Yepp, never hit me that it would influence the map as well. Thanks for all the help.
1 vote
Accepted

Make a Leaflet Tooltip draggable

You can use tooltip .getElement() method to get tooltip DOM element and then make it draggable with the L.Draggable class (see https://leafletjs.com/reference.html#draggable). Code to make tooltip ...
  • 20.3k
1 vote

Custom ordering/z-index of icons in Leaflet layer

As stated in https://gis.stackexchange.com/a/115954/35248 the source problem, is that markers have a default zIndex which is build by the y pixel position. With this knowledge, we can simply overgo ...

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