Questions tagged [leaflet]
An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps
4,092
questions
0
votes
1
answer
17
views
Interpolate a GeoJSON file
I have a geoJSON file which consists of rainfall data in a location.
I want to interpolate those point data's in GeoJSON and make a raster file, and display in leaflet map. How can I do this?
0
votes
0
answers
6
views
leafsync strange behaviour - duplicate maps when syncing two different maps
I have a bizarre thing going on with leafsync::sync. I have two maps generated using mapview function in r. The underlying data is in sf format
map1
map2
As you can see they are two different maps ...
0
votes
0
answers
9
views
Simple method to display thumbnails of a list of polygon on a satellite map layer for each polygon drawn by user
I have a web application displaying a Leaflet satellite map using simple JavaScript on the client-side and Flask on the backend. I have given the user ability to create polygons on the map which are ...
1
vote
1
answer
39
views
Disabling Geoman edit mode for certain layers in Leaflet?
Cross post from SO. I use leaflet geoman for editing lines and leaflet-arrowheads for rendering lines direction. I am looking for a way to disable leaflet geoman edit mode for layers generated by ...
1
vote
1
answer
43
views
Retrieve geometry from GeoJSON to L.polygon in Leaflet?
Since I have a problem with Leaflet draw, which, unfortunately is discontinued, I'm trying to rely on Leaflet editable for editing: before I learn how to save edits, I just want to retrieve a polygon ...
1
vote
1
answer
55
views
Draw line between China and South America through the Pacific Ocean in Leaflet
I am relatively new using Leaflet.js. I want to draw a polyline in Leaflet.js between China and South America through the Pacific Ocean. Instead, I can only draw this line through both places through ...
0
votes
1
answer
49
views
Using Overpass Turbo output as GeoJSON input to leaflet.js [closed]
I'm trying to get GeoJSON using Overpass Turbo for a number of roads within a certain area. The input to Overpass below produces a map with the selected roads highlighted and what looks like JSON, ...
0
votes
1
answer
21
views
Adding title for each part of layer control in Leaflet
I create a Leaflet map containing some base maps and overlay maps. I want to organize the layer control so that these two parts separated by a title,
so I want to have such a view on my layer control:
...
2
votes
2
answers
66
views
Create wider selection area to select lines on map using LeafletJS
When there are thin lines on the map, it is very difficult to click them with the mouse cursor. So is there any option to wider the selection area for lines in LeafletJS, without increasing the line ...
1
vote
0
answers
55
views
How to rotate folium CustomIcon
I have dataframe; it has name, latitudes, longitudes and heading.
Heading value will between 0 and 360. According to the angle we need to rotate.
I printed my dataframe items inside folium map in ...
1
vote
0
answers
44
views
Using the L.CRS.Simple in Leaflet, can I make my map wrap?
I'm using Leaflet with L.CRS.Simple and a L.imageOverlay custom non-earth map (no tiles). I'd love to wrap longitude around the image's bounds, but that doesn't seem to be supported in this CRS, or is ...
0
votes
1
answer
36
views
Only blue geometries shown for protobuf vector tiles in Leaflet
I'm trying to use my vector tile server with Leaflet.
I have this index.html:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, ...
0
votes
0
answers
106
views
Developing Heatmap using Next.js and react-leaflet
For a research project, I was tasked to develop a GIS very similar to https://cwfis.cfs.nrcan.gc.ca/interactive-map. This is the first time I will develop a GIS-related web application and I do not ...
0
votes
1
answer
39
views
Limit map zooms to integer zoom level after initial fractional zoom in Leaflet?
I have a map that defaults to a fractional zoom level for a particular reason. (I need to keep it this way if at all possible.)
However, whenever the user zooms in or out by any means, I want the map ...
0
votes
0
answers
25
views
Combined style for GeoJSON line in Leaflet
In leaflet I have a GeoJSON of line type. I want the latter to have two styles, the solid color in the background and a dotted line inside, as shown in the following image:
In the image, I have two ...
0
votes
1
answer
27
views
Zoom to layer bounds on popup close in Leaflet
I have a GeoJSON data layer in a small Leaflet project and initially I zoom to its bounds.
map.fitBounds(dataLayer.getBounds());
I bind popups to each feature and zoom to the clicked feature when the ...
1
vote
1
answer
47
views
Initial zoom to GeoJSON object from file (.js) in Leaflet
I am building a viewer with Leaflet API and OpenStreetMap base. I want that when I enter this viewer it shows me immediately in the initial visualization the extension of my layer that I am using. For ...
1
vote
1
answer
43
views
L.geoJSON layer - it seems to add a layer for every feature rather than being a group?
I have a topojson file that describes 2400 features. When I add it to the map and then
mapObj.eachLayer(function(layer) {
console.log(layer)
}
I wind up with 2400 layers being printed to the ...
0
votes
1
answer
39
views
MarkerCluster element popup does not appear when clicking a spiderfy element, instead unspiderfy is triggered in Leaflet
I have created a custom popup that appears whenever an element on my map is clicked. However, when spiderfy happens (when a marker cluster is clicked and the map cannot zoom to a level that would ...
1
vote
0
answers
51
views
MarkerCluster does not zoom when cluster clicked if it cannot reach a zoom level that will separate elements. How can I check for this? [closed]
I have a map with a maximum zoom level of 18. It is possible to have data points that are so close together that they are still clustered at zoom 18, and it is also possible to have multiple data ...
1
vote
1
answer
42
views
Generate popup message which shows the coordinates on drawn and edited polygon in Leaflet?
I am using Leaflet map. I am trying to have a popup message which shows the coordinates on drawn polygon. However when I am trying to edit the drawn polygon using the edit layer the coordinates in the ...
0
votes
0
answers
80
views
Click feature doesn't work dash-leaflet
I've created one dashboard with spatial data and plot it with dash-leaflet package.
The main screen above:
The goal is create a popup filled by picture map like it:
I put the monitoramento-dissolve ...
1
vote
1
answer
51
views
Creating a HTML webmap using both ESRI JavaScript API and Leaflet
I have created an ESRI JavaScript based map. It is reading in a webmap from my ArcGIS Online account and works as is required.
I would like to include some additional context to my webmap through the ...
1
vote
0
answers
94
views
Mbtiles to plot in map using react-leaflet
I am new to map technology and I am using react-leaflet to plot GEOJSON to map. It was all going well but then I m facing load time with massive GeoJSON data, so need to convert GeoJSON to mbtiles. ...
0
votes
0
answers
27
views
Query Oracle for new data based on properties of visible markers?
I'm very new to R/Shiny/Leaflet.
I have a barebones working example where I can display points on map based on their lat/long in a table I pull from Oracle:
siteData <- conn %>% tbl(in_schema(&...
1
vote
2
answers
69
views
Prevent automatic zoom on location found event in Leaflet?
I have created the beginnings of a web app which will track locations in real time. It's all working, but every time the location updates, the zoom level refreshes to something that seems pre-defined. ...
1
vote
1
answer
152
views
Project React-Leaflet map in different projection
I am working on a college project that deals with MAPS. Our project is related to mapping the location of stadiums for the recent FIFA worldcup. The tileserver url provided to us is custom.
When I use ...
0
votes
1
answer
53
views
Leaflet.markercluster with GeoJSON via AJAX [closed]
I am pretty new to this. Have found a similar question here but I have been unable to implement it in my own case. The markers show up just fine but no clustering happens.
function onEachFeature(...
0
votes
0
answers
143
views
Uncaught TypeError: L.geoJSON is not a function
I am new to Leaflet and trying to add popup in leaflet map. I saw the example in leaflet website to add geojson polygon and popup on it.
However when i tried to run it shows error:
"Uncaught ...
0
votes
1
answer
45
views
Resizing Window leads to Zoom = 0 in Leaflet
I am working on a small hobby project for the mobile phone.
Everything works fine except when I change the windows size (eg. by flipping the orientation of the smart phone).
As soon as I change the ...
0
votes
0
answers
46
views
Using iPhone coordinates with Leaflet
I'm working on a Leaflet map using Chrome on a PC and everything works fine when I use my computer or Android phone.
But when viewed in Chrome on an iPhone, the coordinates get shifted, like below.
.
...
0
votes
1
answer
50
views
Property e.propgatedFrom.feature not available in marker cluster click event in Leaflet
In a Leaflet map, when a point feature is clicked I want to capture its attributes and pass them onto some variables. The point feature is part of a cluster.
The leaflet marker cluster is sourced as ...
0
votes
0
answers
21
views
How to format the text and font color or background in a React-Leaflet Overlay component
I am using the react-leaflet library and am using the LayersControl components. I have numerous categories where I would like to format the text and color of the font to match the color of the that ...
0
votes
1
answer
118
views
Need to draw exact polygon of political boundary
I have a map in Leaflet:
<TileLayer
attribution='© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors © <a href="...
1
vote
1
answer
75
views
Changing turf.js buffered polygon corners to sharp corners in Leaflet?
I'm using Turf JS to make a polygon bigger with 10 meters:
var buffered = turf.buffer(polyGeoJSON, 10, { units: 'meters' });
and after, I'm adding it to the map
var outerBuff = L.geoJSON(buffered , {
...
1
vote
1
answer
38
views
Setting bounds to combination of two GeoJSON layers in Leaflet?
I am creating an app with django, geodjango and Leaflet, I am also using django-geojson and django-leaflet.
I manage to insert on a map two features that contain points. But I am getting problems ...
1
vote
1
answer
44
views
Determine loading state of base map layers in Leaflet?
What is the JavaScript command to know the loading state of the current layer? I'd like to know is the layer is loading, with 'true' or 'false', when the page loads or when I move the map.
This ...
0
votes
0
answers
81
views
TIFF image layer doesn't show on Leaflet map
Trying to display an image as layer on a Leaflet map but having some trouble. I don't know what I'm doing wrong.
%pip install segment-geospatial groundingdino-py leafmap localtileserver
import ...
0
votes
0
answers
48
views
Way for popups to be shown when using the clustering feature of QGIS2Web (Leaflet)
I have been making use of the QGIS2Web Plugin (current version 3.16.0) to create interactive maps (Leaflet) with great success thus far, however I have now discovered an issue when I use the "...
1
vote
1
answer
63
views
Displaying streaming video in popup Leaflet?
I have a GeoJSON with CCTV camera tags and links to m3u8 streaming video. I'm trying to open a streaming video from surveillance cameras in a popup on Leaflet, but nothing comes out. I don't know much ...
0
votes
1
answer
478
views
Setting marker cluster icon color dynamically in Leaflet?
In a Leaflet map, when a school point is clicked it passes an id of that school and adds a student point layer specific to that school. The point layer is rendered on the map as marker cluster. So, ...
0
votes
0
answers
71
views
QGIS Generate XYZ tiles from bluemarble - result is garbage
I am trying to learn QGIS and working with tiled maps.
I have downloaded blue marble files from nasa (8 files 21600 x 21600 that span the entire earth), combined them into one tiff via GDAL, as well ...
-1
votes
1
answer
100
views
Getting all layers hovered over in a layer stack in Leaflet?
Using Leaflet with a map that has multiple layers on it, how can i get a list of all the layers hovered over, a la ArcGIS Online?
For example, suppose i have two circles A and B on a map in standard ...
1
vote
1
answer
119
views
Clipping raster layer created by Georaster plugin in Leaflet?
I want to clip a raster layer inside Leaflet. I want it to clip by a GeoJSON.
I couldn't find an effective method to do it. The below code is what I have done so far. Can anyone suggest a method?
var ...
0
votes
1
answer
52
views
Problem with GetFeatureInfo request on INSPIRE cadastre using Leaflet
Using Leaflet with the https://github.com/heigeo/leaflet.wms library, I have problems with GetFeatureInfo on the WMS INSPIRE cadastre. However the normal WMS works without problems. In the case of ...
1
vote
0
answers
68
views
Loading local GeoJSON file into Leaflet [closed]
I have an issue with loading a local GeoJSON file into a simple Leaflet map.
I followed the answer from Loading external GeoJSON file into Leaflet map?:
I included the path to the leaflet.ajax.min.js ...
1
vote
1
answer
54
views
Extract fetaure from GeoJSON layer and submit it to turf.js function in Leaflet
A Leaflet layer holds some objects and each one has a bindpopup enabled,
now I can't pass a single of these objects to a turf function (in that case, buffer). I know I have to translate this single ...
2
votes
1
answer
141
views
How to add categorised colours to leafmap polygons
I have started using Leafmap and am having difficulty categorising colors into polygons based on unique 'SLOPE' values. I am able to build the map I want in Folium, and I want something similar in ...
1
vote
2
answers
58
views
Distorted image overlay in Leafet and Mapbox
I have created some png images from a tiff using gdal_translate
It fits well in QGIS
Info from QGIS about the layer
Extent -63.0499992370605469,-11.0499992370605469 : 101.9500007629394531,71....
0
votes
0
answers
28
views
GetFeatureInfo not working in R with leaflet.extras2
leaflet.extras2 provides a working example for clicking on a feature and displaying its attributes; however, when I try to run it with my geoserver it doesn't display attributes, I assume there's a ...