Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [leaflet]

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

40
votes
13answers
31k 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 ...
45
votes
5answers
84k 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 ...
7
votes
3answers
2k views

great circles in QGIS and export in 3857 webmap

My plan is to visualize great circles in a leaflet webmap. So coming from this great postgis article and R version I thought it would work like this in QGIS: create line from two points, store ...
31
votes
5answers
89k 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)...
13
votes
2answers
14k 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 ...
8
votes
1answer
21k 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&...
10
votes
2answers
12k 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 ...
4
votes
1answer
11k 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 ...
2
votes
1answer
1k views

GeoServer Callback Function Undefinded

Any idea why the function loadThis() comes back as undefined? I've tried adding jsonp: false which doesn't help either. The json object is returned properly, I can view it in FireBug, but I can't get ...
16
votes
1answer
35k 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 ...
7
votes
1answer
9k 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 ...
1
vote
1answer
2k 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 ...
59
votes
7answers
12k 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 ...
85
votes
8answers
59k 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 ...
26
votes
2answers
35k views

Adding/Removing Leaflet GeoJSON layers

I'm 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 don't actually want them all to show at once). I ...
7
votes
4answers
23k 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/...
28
votes
1answer
21k 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
2answers
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 ...
11
votes
1answer
6k 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.
10
votes
1answer
33k 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 ...
4
votes
3answers
4k 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 ...
1
vote
1answer
246 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 ...
17
votes
2answers
10k 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...
16
votes
3answers
16k 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.
6
votes
3answers
16k views

Is it possible to convert regular JSON to GeoJSON?

My apologies if this is a repeat question, I searched here and couldn't find an answer. I have JSON data I've exported from Openpaths.cc which contains lat and lon values. However, the data is not in ...
4
votes
1answer
16k 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
2answers
9k 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 ...
2
votes
1answer
2k 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(...
7
votes
5answers
9k 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 ...
3
votes
1answer
2k 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()....
1
vote
1answer
4k views

Addig title to marker or shape using Leaflet Draw? [closed]

I am trying to create a participatory mapping site where users can draw pts, lines and polys using Leaflet draw. Is it possible to create a pop window where users can add a title or description of ...
8
votes
2answers
14k 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 ...
6
votes
2answers
8k views

Fly To Location in Leaflet

Is it possible to 'fly to location' in Leaflet in the same way as this Mapbox GL example?
5
votes
1answer
6k 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/...
4
votes
2answers
3k views

How do you get the nodes of an area in Overpass API in the “right” order?

I use the Overpass API to get the boundary of an OSM relation. I then use the result to display the boundary on a leaflet map. My problem is however, that the nodes are not in the "right order". ...
3
votes
2answers
2k 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 ...
1
vote
2answers
7k views

How to export to all points within Leaflet polygon?

Is it possible to export all points within a polygon drawn using Leaflet? (http://leaflet.github.io/Leaflet.draw/).
0
votes
1answer
2k views

resize divIcons (svgs) at zoom levels - Leaflet

I am adding a geoJSON to a map using a custom divIcon (from svg) for point markers with Leaflet. The divIcon needs to resize on different zoom levels. Currently I can see the icons and the popup ...
6
votes
3answers
3k views

Removing tooltip label border completely in Leaflet.js map?

I am trying to completely remove a label boundary/border (bubble) that by default appears when using my labels of a point GeoJSON layer. The layer I have is defined as below: var points_layer = new ...
5
votes
1answer
2k 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.
2
votes
1answer
4k views

Convert GeoJSON with multiple Polygons and MultiPolygons into single MultiPolygon?

Is this even possible? I have a GeoJSON file with multiple polygons and multipolygons, and I need to set styling on them (in Leaflet.js). I'd like to create a single, large MultiPolygon from the ...
2
votes
1answer
4k views

Is it possible to cluster polygons in Leaflet?

Is it possible to cluster polygons in Leaflet? In a similar way to the Marker Cluster plugin
1
vote
1answer
1k views

GeoServer TMS with leaflet coordinates are different

I use the example tiger-ny layer from geoserver with leaflet like this: var map = L.map('map').setView([62.92578, 32.08523], 13); L.tileLayer('http://localhost:8080/geoserver/gwc/service/tms/1.0.0/...
1
vote
2answers
2k views

Defining which layer (overlay) is displayed on Leaflet map?

I have 7 layers overlay on a base map, i need to define which layer is selected (active,displayed,shown) on the map. var overlays = { "AL HOUDA Espaces_Verts": alhouda6_layer, "...
4
votes
1answer
1k views

Day and night zone layer for Leaflet

I'm working with Leaflet and I'd like to show the day and night zones adding a dynamic layer to my map. I was thinking to add a static layer with some transparency and make it move every x minutes but ...
3
votes
1answer
96 views

leaflet GeoJSON value not variable name

I have a GeoJSON file that has fields of the days of the week like "Monday" with values 'Y' or 'N'. So I want to get today's day value, using something like var theDayValue = 'feature.properties + ...
3
votes
1answer
865 views

How to turn off geojson layers in Leaflet when the site starts?

I have a problem with my geojson layers. When I lunch my site they are all switched on, but I don't want to. Is there any solution to have lunched only one layer when my site starts, not the all one? ...
3
votes
2answers
1k views

Using JSONP with Leaflet and GetFeatureInfo request

Is it possible to use JSONP with the GetFeatureInfo request? I'm using a GetFeatureInfo function in Leaflet that works fine with JSON data but I'm really struggling to replicate this with JSONP and ...
2
votes
2answers
2k views

Viewing map tiles from Maperitive in leaflet or openlayers

I generated tiles in Maperative. Created following html file: <html> <head> <meta charset="utf-8" /> <link rel="stylesheet" href="leaflet/leaflet.css" /> ...
1
vote
0answers
343 views

Export ShapeFile from layer file lyr

I want to export shapefile from geojson. I am getting the all data of dbf file in console. My project is based on GIS. I am using LeafLet for that. How can I get a shapefile and it's all supportive ...