Questions tagged [leaflet]
An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps
398
questions
68
votes
7
answers
149k
views
Loading external GeoJSON file into Leaflet map?
I would like to load a geoJSON (polygon) file into my leaflet map. I have seen examples where geoJSON is embedded into the javascript code but I can't find any examples showing how it is done with an ...
49
votes
14
answers
43k
views
Converting ArcGIS Server JSON to GeoJSON?
I'm creating a web map using Leaflet, and I want to be able to grab feature layers from our ArcServer. I have successfully been able to retrieve a feature class as JSON, but Esri's JSON objects don't ...
8
votes
3
answers
3k
views
Great circles in QGIS and export in 3857 web map
My plan is to visualize great circles in a Leaflet web map.
So coming from this great postgis article and R version I thought it would work like this in QGIS:
create a line from two points,
store ...
48
votes
5
answers
148k
views
Showing popup on mouse-over, not on click using Leaflet?
Is it possible in Leaflet that popup opens on mouse-over, not on click?
This is working for just one marker at a time, but I need it for a bigger number of markers:
marker.on('mouseover', function(e)...
14
votes
3
answers
41k
views
Displaying properties of GeoJSON in popup on Leaflet?
This is my simple GeoJSON with Leaflet map. I want to display properties as popup but I don't know why it is empty.
Can you tell me my mistake?
<html>
<head>
<title>A Leaflet map!...
14
votes
2
answers
23k
views
leaflet geojson coordinate problem
I just started to play with leflet/geojson a little. But my coordinates are not rendered properly and I have no clue what is going on.
My coordinates are: 52.23943, 4.97599. They work correct with ...
20
votes
1
answer
62k
views
How to change Leaflet Map panes layering order (z-index)?
Leaflet maintains that the Map panes elements contain all layers added to the map. The difference between many of the Map panes is strictly the z-index order of layering.
I would like to use a ...
1
vote
1
answer
3k
views
Splitting a polygon by multiple linestrings leaflet and turf.js
I am trying to implement an utility for land subdivision using leaflet and turf. I am not sure if these tools are the right ones for the task. I've got it right for most of the scenarios but sometimes ...
113
votes
8
answers
90k
views
Choosing OpenLayers or Leaflet? [closed]
I was debating with one of my collegues on OpenLayers v/s Leaflet. I made a point that OpenLayers is much better API if we wish to build a project, where you need direct connectivity to the Geoserver ...
11
votes
2
answers
18k
views
How to add Geoserver WFS to Leaflet JS Application
I have a PostGIS database and have successfully consumed a table into GeoServer and published a WFS. Are there REST endpoints available for these WFS' akin to ESRI's feature services? How are ...
9
votes
1
answer
26k
views
Combine Leaflet with Geoserver WMS map
I'm not very skilled within the GIS world, however, I would like to know if it's possible to use this map:
http://wfs-kbhkort.kk.dk/k101/wms?service=WMS&version=1.1.0&request=GetMap&...
5
votes
1
answer
6k
views
Multiple on-the-fly filtering based on markers' features on leaflet
I would like to filter the markers on my (geojson) layer according to two features: year and type of event, ideally using both filters (year and eventType) as check-boxes without using layerGroup at ...
2
votes
1
answer
870
views
Small features don't draw when zoomed out using Geoserver WMS
I am using Leaflet to access polygon layers through Geoserver WMS. When I zoom out the smallest polygons will disappear and not draw. They would essentially be a dot if they did draw. Is there a way ...
1
vote
2
answers
870
views
GeoJSON does not appear on my Leaflet map
I'm a beginner in Leaflet and I need help to deal with GeoJSON files.
I succeeded in creating a Leaflet basemap. I can add markers without troubles but I cannot manage to show a GeoJSON layer.
Here ...
13
votes
1
answer
22k
views
How to label geojson points in Leaflet?
How to show labels for geojson points in a Leaflet map?
There is Leaflet.label that is now deprecated in favour of L.Tooltip, but that only shows text on hover. I want to show the text labels ...
13
votes
1
answer
26k
views
Overriding Leaflet tooltip style?
I'd like to override the default style of Leaflet 1.0.0 tooltips, especially the bubble/frame. I don't see any options or methods for this. How do I hook into the CSS? I want to change layers ...
4
votes
3
answers
5k
views
Leaflet proj4leaflet with multiple projections
I am looking at having both EPSG4326 tiles and EPSG3857(cloudmade) tiles on a single map (but separate layers). I have been looking at the proj4leaflet plugin, and it "appears" to me that this might ...
2
votes
0
answers
449
views
Polygon intersection using turf js
I have given this code for intersection:
function intersectPolyByPolyFC(poly,fcPoly){
var fgp=[];//variable for feature group
var bbPoly=turf.bboxPolygon(turf.bbox(poly));//polygon ...
1
vote
1
answer
3k
views
How to add a bounding box filter to this leaflet WFS request?
I use this function to add an interactive layer to my leaflet application. It works great in most browsers, but fails due to time-out error on certain networks and browsers.
The solution I think is to ...
0
votes
1
answer
2k
views
Turf intersect point with Leaflet GeoJSON error
Leaflet and Turf. I am trying find all the layers on a Leaflet map that intersect a point when the user clicks on the map. I am using the turf library to test for this. In the console when I click on ...
60
votes
7
answers
13k
views
Creating Vector Polygons with rendering performance like GISCloud?
I have been looking for a solid solution which would allow me to create a web map and overlay vector polygons without taking forever to load such data with the goal of allowing me to make each polygon ...
32
votes
3
answers
49k
views
Adding/Removing GeoJSON layers using Leaflet
I am trying to show different GeoJSON layers at different zoom layers using the Leaflet API. I can load and display all three layers at once (though I do not actually want them all to show at once). ...
9
votes
4
answers
41k
views
Getting WFS data from Geoserver into leaflet
I'm trying to use a ajax call to load WFS data from geoserver into a GeoJson layer in leaflet.
When I do the following message in the console:
XMLHttpRequest cannot load
http://localhost:8080/...
31
votes
4
answers
32k
views
Disable leaflet interaction temporary
How can I temporary disable zoming/draging the Mapview in Leaflet.js
Tried so many ways but without any luck.
It's important to make it temporary and I also need the option to enable again.
14
votes
2
answers
15k
views
Placing controls outside map container with Leaflet?
Can someone tell me how I can place controls outside of the map content with Leaflet?
In this case, I just want to place the layer switch control outside the map object.
9
votes
3
answers
22k
views
Leaflet layers on different zoom levels. How?
I've added a polygon layer and a point layer to my leaflet map.
I would like the points to appear after a certain zoom level or when a "click" event occurs e.g. (polygons.on("click", function....)
...
16
votes
1
answer
80k
views
Adding a search box to a Leaflet.js example
Consider the example in the following link for Folium: US Employment visualization per county.
The result looks like what you see below:
I would like to add a search box to it to be ...
16
votes
2
answers
6k
views
How can I make a polyline wrap around the world?
I am using leaflet maps to create a representation of a round-the-world challenge. I would like to add a polyline which heads east from tokyo and then appears west of south america on the map - but ...
10
votes
4
answers
4k
views
Advantages of WFS over GeoJSON/KML?
I'm planning to create an online map with openlayers (2 or 3) or leaflet. I have to show some points/markers (~30.000), polygons (~500) and lines on top of an OSM map in several layers. Those points ...
6
votes
1
answer
6k
views
Tile names & coordinates relationship
I'm aware that this site is intended for cartographers, geographers and GIS professionals. I must admit that I'm absolute beginner in the area of maps, but not in the area of programming (40+). I hope ...
4
votes
1
answer
13k
views
How do I get GeoJSON data from GeoServer into show up on my Leaflet map?
I'm trying to create a simple "Green" map for my city. The idea being that it is a website with a map and layers you can turn on and off. I am serving the data through GeoServer and am using GeoJOSN ...
4
votes
1
answer
3k
views
How to access Leaflet EPSG:3857 coordinates?
I read everywhere that Leaflet is internally using a spherical web mercator (EPSG:3857), but whatever I try I get either Lat/Lon (EPSG:4326) or strange coordinates I dont understand:
map.getBounds()....
3
votes
2
answers
11k
views
GTA V coordinates to LatLng
I'm here because I'm trying to create a GTA V map with Leafletjs API. In deed, I've got my tiles that are ready. But the aim is to put markers on the map by using GTA V in-game coordinates. To achieve ...
9
votes
1
answer
13k
views
Leaflet GeoJSON with projected coordinates (3857)
I am trying to get a GeoJSON with projected coordinates to show in Leaflet.
I have no problems loading GeoJSON with lat/lng (EPSG:4326). Here is a fiddle where I load the GeoJSON with unprojected lat/...
6
votes
2
answers
22k
views
How to edit an existing layer using leaflet?
I am used to working
with OL3 and I wanted to try using leaflet and see if it is as powerful as OL. I loaded a map with some data from a GeoServer WFS layer using this tutorial from Georepublic.
var ...
5
votes
4
answers
4k
views
Can Geoserver return the raster value of a lat/lon point
I have a GeoTIFF published by Geoserver 2.2 and being used by Leaflet via WMS. How can I get Geoserver to return the raster value at a lat/long point?
I'm guessing it has to do with using WCS, but ...
1
vote
1
answer
756
views
Leaflet side by side plugin is not working with imageOverlay
I'm trying to use the side by side plugin. I already check in the issues and change the getContainter() with getPane() in the .js file.
this._divider.style.left = dividerX + 'px'
this.fire('...
0
votes
1
answer
2k
views
Displaying selected layers depending on zoom in Leaflet
It looks like I found the problem between the document.querySelector and map.on('zoomend') function.
I was going to set the zoom level for switching off some layers, what has been raised here:
...
18
votes
2
answers
14k
views
What is the most common way of displaying geodata from Postgis on Leaflet?
For example, in my database I've some points with geographic coordinates. I want to display them on Leaflet JS layer. Which instruments should I use? Maybe there is some API...
15
votes
3
answers
48k
views
Is it possible to convert regular JSON to GeoJSON?
I have JSON data I've exported from Openpaths.cc which contains lat and lon values. However, the data is not in GeoJSON format so can't be read by OGR2OGR.
Could anyone point me in the right direction ...
34
votes
1
answer
36k
views
What is the default projection in Leaflet?
I've read an API documentation for Leaflet on its site, but I can't realize: what is a default projection to view maps? It was written about spherical and elliptical Mercator and Equirectangular - so ...
17
votes
2
answers
3k
views
Understanding web mapping tools [duplicate]
Before I start, this is going to be a general question but with specific cases. I've been trying to understand GIS tools and applications to achieve the following:
Build my own basemap
Publish the ...
14
votes
2
answers
38k
views
Leaflet: How to move the layer-control menu?
This might be a silly question, but I could not find a documented way to achieve this.
I'd like to freely position the layer-control menu, probably to the top left near the default zoom-in/out button....
3
votes
3
answers
14k
views
Incorporate Google Streetview into a Leaflet map
The person who asked the question at the link below way back in 2011 said, "I understand that it is possible to incorporate Google StreetView into non-Google apps".
Can anyone tell me how this is ...
4
votes
1
answer
30k
views
How to get LatLng array from geoJSON Layer in Leaflet?
i need to hand the latlng coordinates from my phpPostGIS-served geoJSONLayer as an array over to a new added HeatMap Layer. L.geoJSON has an build-in option: coordsToLatLng( coords )" and a static ...
2
votes
1
answer
4k
views
Filling contour levels with grain (texture) using Leaflet
I created a program to draw temperature contour map of France:
This is the code:
library(ggplot2)
library(gstat)
library(sp)
library(maptools)
require(rgeos)
library(rgdal)
library(foreign)
library(...
18
votes
1
answer
35k
views
How to check if a leaflet layer is already added on the map?
I built a simple map app where I have a layer on top of a map. In Leaflet, how can I check if the layer is already present?
14
votes
2
answers
35k
views
Loading vector tile layer in Leaflet map?
I need to load a vector tile layer in a Leaflet map.
The vector tile is the vector tile layer about Mapillary sequences (look at https://a.mapillary.com/#vector-tiles ...), and the tile URL pattern ...
11
votes
2
answers
26k
views
Fly To Location in Leaflet
Is it possible to 'fly to location' in Leaflet in the same way as this Mapbox GL example?
8
votes
5
answers
12k
views
How to get a Leaflet app with a big GeoJSON file to work on mobile devices?
I have a leaflet app which displays a GeoJSON file as a layer. It works fine in the web browser. On the mobile browser it starts up, but quits after panning around on the map. I think the reason for ...