Skip to main content

Questions tagged [leaflet]

An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps

Filter by
Sorted by
Tagged with
250 votes
4 answers
281k views

EPSG 3857 or 4326 for Web Mapping

The discussion at What is the difference between WGS84 and EPSG4326? shows that 4326 is just the EPSG identifier of WGS84.. Wikipedia entries for Google Maps and OpenStreetMap shows that they both ...
tmaj's user avatar
  • 2,613
72 votes
7 answers
171k 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 ...
bailey's user avatar
  • 1,281
50 votes
14 answers
47k 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 ...
Tanner's user avatar
  • 7,383
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 ...
Riccardo's user avatar
  • 2,668
52 votes
5 answers
169k 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)...
againstflow's user avatar
  • 5,044
20 votes
1 answer
74k 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 ...
Michael Markieta's user avatar
15 votes
2 answers
24k views

Leaflet geojson coordinate problem

I just started to play with leaflet/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 ...
LarsVegas's user avatar
  • 2,556
1 vote
1 answer
6k 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 ...
Arul Rozario's user avatar
119 votes
8 answers
98k 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 ...
Sam007's user avatar
  • 4,415
18 votes
3 answers
53k 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!...
Alex's user avatar
  • 181
11 votes
2 answers
19k 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 ...
Geoffrey West's user avatar
9 votes
1 answer
29k 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&...
user809829's user avatar
2 votes
1 answer
1k 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 ...
user86605's user avatar
1 vote
2 answers
3k 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 ...
RG70's user avatar
  • 31
16 votes
1 answer
29k 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 ...
matt wilkie's user avatar
  • 28.2k
15 votes
2 answers
32k 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 ...
Tom Chadwin's user avatar
  • 5,862
8 votes
1 answer
5k views

Get bounding box of WMS

Is it possible to request the bounding box of a WMS from GeoServer? In my case I have a WMS that I show with L.TileLayer.WMS in a Leaflet map. I like to center and zoom my map to the WMS.
ustroetz's user avatar
  • 8,024
8 votes
3 answers
17k views

Load a raster file directly in Leaflet

Is it possible to load a raster file (e.g. GeoTIFF or Erdas img) directly into a Leaflet map? If so, can you guide me to the correct documentation or method to do this? I am trying to do this with the ...
geo derek's user avatar
  • 529
6 votes
1 answer
10k 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 ...
user134763's user avatar
4 votes
3 answers
6k 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 ...
Dr.YSG's user avatar
  • 1,367
2 votes
0 answers
929 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 ...
Ruhi Bhartiya's user avatar
1 vote
1 answer
4k 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 ...
Ilona Kemeling's user avatar
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 ...
ziggy's user avatar
  • 4,536
60 votes
7 answers
14k 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 ...
NetConstructor.com's user avatar
33 votes
3 answers
52k 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). ...
Josh's user avatar
  • 1,162
32 votes
4 answers
41k 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.
Bernie's user avatar
  • 503
17 votes
1 answer
94k views

Adding search box to Leaflet.js

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 able to ...
Amelio Vazquez-Reina's user avatar
16 votes
2 answers
19k 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.
mauricio santos's user avatar
16 votes
2 answers
7k 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 ...
codecowboy's user avatar
11 votes
3 answers
26k 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....) ...
LAC's user avatar
  • 611
10 votes
4 answers
5k 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 ...
stofl's user avatar
  • 273
10 votes
2 answers
15k views

What does the default crs being EPSG:3857 in Leaflet mean?

In the documentation of leaflet, it says the following about the projection that is being used: L.CRS.EPSG3857 The most common CRS for online maps, used by almost all free and commercial tile ...
user avatar
9 votes
4 answers
46k 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/...
Matt T's user avatar
  • 688
9 votes
1 answer
16k 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/...
Dennis Bauszus's user avatar
8 votes
1 answer
7k 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 ...
TomazicM's user avatar
  • 26.3k
8 votes
1 answer
28k views

Filtering GeoJSON data to include in Leaflet map

I am trying to filter through my geojson polygons and get all data entries with a specific attribute. I have a layer of polygons describing parks around the city parks.json. I want the user to click ...
user2192778's user avatar
6 votes
2 answers
27k 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 ...
Hicham Zouarhi's user avatar
5 votes
4 answers
6k 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 ...
Nyxynyx's user avatar
  • 1,687
4 votes
1 answer
4k 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()....
q9f's user avatar
  • 2,176
4 votes
1 answer
14k 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 ...
T_9er's user avatar
  • 298
3 votes
2 answers
12k 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 ...
Templeton Peck's user avatar
2 votes
1 answer
1k 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('...
Micmic's user avatar
  • 103
0 votes
1 answer
3k 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: ...
Geographos's user avatar
  • 4,029
39 votes
1 answer
44k 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 ...
Anton's user avatar
  • 491
22 votes
2 answers
45k 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 ...
Cesare's user avatar
  • 2,011
20 votes
1 answer
44k 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?
user1919's user avatar
  • 2,654
20 votes
2 answers
16k 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...
John Smith's user avatar
18 votes
1 answer
3k views

How to copy the color styling to a color column in a layer's attribute table?

I have a polygon layer in QGIS that I have applied a random color style to each polygon. Under Layer Properties -> Style I selected a Categorized style and then generated a random color ramp. I added ...
user2956607's user avatar
16 votes
3 answers
64k 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 ...
clhenrick's user avatar
  • 1,845
15 votes
2 answers
44k 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....
fgysin's user avatar
  • 570

1
2 3 4 5
9