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

15
votes
0answers
1k views

Leaflet v1 plugin: layer control for ungrouped, grouped, and nested-grouped layers

I need a Leaflet plugin which extends L.Control.Layers. I have the following requirements: works with Leaflet 1.x handles ungrouped layers alongside grouped ones handles nested layer groups does not ...
5
votes
0answers
154 views

Using WFST in Leaflet: can not move/delete features

I write a Leaflet app which makes use of two plugins Leaflet.Draw and Leaflet.WFST. The first allows to create/edit/delete features, the second saves changes to my PostGIS database hosted by GeoServer....
4
votes
0answers
611 views

What is the best way to display a large shapefile (with polygons) as a layer on a leaflet map?

I have a leaflet map of the UK with around ~2000 points total points and a bit of metadata loading for each point with two side-panels showing the metadata. These points are drawn from several tables ...
4
votes
0answers
657 views

Create Vector Tiles from Local GeoJSON

Background In a leaflet application I am currently using geojson-vt to turn small geoJSON files (45MB) into tiles stored as a javascript variable. This cannot be done with the larger files (900MB) ...
4
votes
0answers
674 views

Load WFS in Leaflet with BBOX query in non-default projection (i.e. not EPSG:3857)

I've had a look at this question: How to add a bounding box filter to this leaflet WFS request? and have been trying to work out how to get it to work in a different projection system, specifically ...
4
votes
0answers
236 views

Thematic map exported using QGIS2Web is extremely laggy

I have made a world thematic map and added layers of data for creating graduated color scheme on the country level. I need a interactive map as an output which shows values when user hover over any ...
3
votes
0answers
40 views

Function fires despite conditional query in leaflet-map

In a map built with Leaflet I created a button to export and download data as geoJSON drawn before by the user with Leaflet.draw. To prevent an empty download, I am querying the existence of data. ...
3
votes
0answers
45 views

Plug in / API for getting sea routes with leaflet

I am developing a maritime routing application prototype with Leaflet.js for my company Deep Blue Globe and using the windy interface. The problem is since windy uses Leaflet version 0.7.7 there are ...
3
votes
0answers
152 views

Markers with customs angle values

I'm trying to make some markers spinnable using this : target = document.getElementById("mapid"); target.ondragover = function(e){ e.preventDefault(); e.dataTransfer.dropEffect = "move"; }; ...
3
votes
0answers
404 views

Make a grid map in Leaflet

I want to draw a grid map based on the temperature values in Leaflet. Similar to the illustration below. Input data: lat, lon, temperature values, cities' names Parameters: the dimensions of the ...
3
votes
0answers
1k views

Get the lat/lng values of lines, polygons drawn by Leaflet drawing tools

I am new to JavaScript and Leaflet too. I made a basic map in Leaflet. I have also floated one sample geojson file in it. Now I also want leaflet for sourcing(co-ordinates) to my PHP file. So I need ...
3
votes
0answers
371 views

Generating tiles from matplotlib plots

I have a number of analyses that are being plotted as heat maps in UTM coordinates using matplotlib. I'd like to generate tiles from these to display on a leaflet map over top of an OSM map. At this ...
3
votes
0answers
345 views

Leaflet map in R Markdown - not rendering when placed after other plots

I have an R markdown document using shiny with 6 or 7 plots. They all display until the 7th plot, which is a leaflet map, which doesn't display - when I 'run document' there is a big empty space at ...
3
votes
0answers
95 views

How to use L.singleTile plugin in Leaflet

I am using Leaflet (leaflet-0.7.3) to publish a WMS layergroup from GeoServer. My code is: var basemap2 = L.tileLayer.wms('http://localhost:8080/geoserver/ows?version=1.3.0&', { ...
3
votes
0answers
100 views

Calculating Detours based on given blocked roads with Leaflet?

Is it possible to use a given route of "blocked roads" and calculate a route from A to B, considering that the given route is off limits using Leaflet? Where I'm from, there is an annual bicycle ...
3
votes
0answers
172 views

Determining map-projected coordinates in custom CRS for Leaflet?

I have some static USA maps in Lambert Conformal projection that I would like to overlay in Leaflet together with geo-reference support. They are centered at 38N, 98W. I have found that the closest ...
3
votes
0answers
534 views

Can't clear markers from MarkerClusterGroup

i have problems removing all markers befor adding new ones. var L_Emergency_Access_Points = L.markerClusterGroup(); var EapMarkers = L.geoJson(null,merge_options(globalOverlayOptions, ...
3
votes
0answers
104 views

Proj4Leaflet - Defining World Eckert IV

I'm trying to make a Leaflet map with World Eckert IV projection using Proj4Lefalet. From what I understand, I should be able to define my CRS like so: var crs = new L.Proj.CRS('ESRI:54012', '+...
3
votes
0answers
245 views

Leaflet marker icon does not change correspondingly

I am building an ASP.NET Core application using Leaflet.js library. On the map I would like to show containers(used for transferring building materials) as markers. These containers can have different ...
3
votes
0answers
580 views

Leaflet.contextmenu plugin runs into Uncaught Type error under certain conditions

I'm working on a leaflet map application getting data from OpenStreetMap and use the Leaflet plugin Leaflet.contextmenu. I have defined a context menu on the map: var Map = L.map('Map', { ...
3
votes
0answers
468 views

Leaflet: Smooth lines between points without control points?

Goal I want to connect points using a polycurve or curved lines in Leaflet in a scalable way. If possible, without defining control points. Approach I'm using the Leaflet.curve plugin which offers ...
3
votes
0answers
488 views

leaflet returns wrong {x} {y} tiles from arcgis mapserver

I'm trying to add a leaflet map to an Angular 2 project, which shows a layer from an ESRI mapserver as a tileLayer. As such: ngOnInit(): void { let map = L.map('map', { crs: L.CRS....
3
votes
0answers
535 views

heatmaps with local maxima, weight, api functionalities

I am looking for a heatmap vizualization on a map, which shows: local maxima: that means that you always see some "red spots" regardless the zoom. See the picture below. enables to set a weight to ...
3
votes
0answers
114 views

Image & limit user access by poly

Wondering how do I clip images to polygon outlines in a web map application based on OpenLayers or Leaflet? How can I limit web map users to see (visualize; qualitative) or query (quantitative) within ...
3
votes
0answers
137 views

Blending edges of tile overlay

I am working on a web map using Leaflet and am using purchased satellite imagery as the base map. We want to limit the extent of the high resolution image to the area of interest, so I have resampled ...
3
votes
0answers
1k views

Leaflet.Draw only edit GeoJSON

I am trying to enable editing of a GeoJSON layer in my Leaflet map using Leaflet Draw. I need to allow only a single edit at a time before saving the results back to the database. I tried to implement ...
3
votes
0answers
96 views

CartoDB.js/Leaflet map - how can I click between multipolygons cleanly?

Here's my map: https://jsfiddle.net/Sidders/4exf969e/3/ I want to apply a click and hover effect to the polygons. So a polygon/multipolygon highlights on hover, and is selected with one click. The ...
3
votes
0answers
513 views

Converting KML coordinates to Leaflet

I am trying to convert a Google Map KML file to a csv, to map the longitude and latitude points on Leaflet. But the coordinates keep mis-projecting and some end up off the land mass. The steps I have ...
3
votes
0answers
2k views

Leaflet filter on geoJson properties : multiple criteria

I'm using Leaflet filter on geoJson data. I'm able to apply it with a simple criteria : filter: function(feature, layer) { return feature.properties.field1 == "yes"; } I can also apply two ...
3
votes
0answers
536 views

Mapbox GL Leaflet interaction

I've built a map in Leaflet which has a really large GeoJSON file. Currently the only way I can get it to work is if I severely simplify the GeoJSON file down from 100mb to 25mb. I'm looking at using ...
3
votes
0answers
1k views

Display GeoJSON data on map using django-leaflet?

I want to display GeoJSON data on map in geodjango. When I use the below code only GeoJSON data like: { "type": "FeatureCollection", "features": [{ "type": "Feature", "properties"...
3
votes
0answers
637 views

Leaflet: get the color of a specified pixel on the map

I need to get the color of a specified pixel on the map. How can I do it using the current API of Leaflet?
3
votes
0answers
604 views

Leaflet filtering existing featuregroup

I have a leftleat map and i would like to filter the featuregroup i am displaying. exp_colJSON = new L.geoJson(exp_col,{ onEachFeature: pop_col, pointToLayer: function (feature, latlng) { ...
3
votes
0answers
681 views

Adding an offset to a Leaflet TileLayer on the fly

I'm currently using Leaflet to display 18th century maps of Belgium as a base layer with a vector overlay of the present day road system. Although the maps are absolutely gorgeous (http://www.ngi.be/...
3
votes
0answers
2k views

How can a leaflet SVG overlay be placed outside of the leaflet-overlay-pane?

I have SVG on top of GeoJSON in my map. How can a leaflet SVG overlay be placed outside of the leaflet-overlay-pane while keeping GeoJSON in place in the leaflet-overlay-pane? (For example, how could ...
3
votes
0answers
670 views

Raster Over Layer in Leaflet from GeoServer

I want to add a raster over layer onto the base layer and the raster layer is published by a Geoserver WMS. I set the raster layer's geographic coordinate system as the same as the cloudmate tiles. ...
3
votes
0answers
441 views

How do I format tilelayer.wms url properties such that I add an overlay iteratively to my base map in leaflet

My base map was created using hard-coded template variables. I am using the leaflet tilelayer.wms constructor and including the url like so: url: "http://localhost:8080/geoserver/sf/wmsservice=WMS&...
3
votes
0answers
2k views

How to serve OpenStreetMap Tiles locally using ArcGIS Server 10?

We want to serve OpenStreetMap Tiles locally using ArcGis Server 10 to use as base maps in our ESRI Silverlight and Flex GIS clients. We've downloaded our regions OSM file and created PNGs using ...
3
votes
0answers
665 views

How do I pass a LatLng Bounds from Leaflet to Mapfish Print?

I successfully fired up a MapFish print server on Elastic Beanstalk, and it prints out the sample spec files fine, but I'm trying to pass bounds from my Leaflet frontend now, and encountering a lot of ...
3
votes
0answers
2k views

Overlaying a mbtiles tile layer produced with tilemill over another layer maintaining transperency

So using leaflet, I'm overlaying my base tile layer as google satellite imagery. I want to overlay another layer (Mbtiles layer) produced with tilemill over this satellite layer. I was successful in ...
2
votes
0answers
37 views

Adding points to map with Leaflet using .forEach function

Trying to add an array of points to a map with a Leaflet with .forEach. I thought this should work, but alas, it does not: var jsonData = [ { "LNG":-75.16472099534634, "LAT":40....
2
votes
0answers
24 views

Leaflet layerGroup in ListMarkers

I am using the Leaflet List Markers Plugin for showing all features currently visible in the map in a list. Adding a single L.geoJson layer is no problem and works fine. Now I am using multiple ...
2
votes
0answers
33 views

GeoJSON - Obtain linestrings inside a given bounding box

I have two layers in an Argentinian railroad-related project: one is for train stations and the other is for railroad lines. The first one has about 1100 points and the second, about 250 finely-...
2
votes
0answers
87 views

Revert the resized polygon in L.Draw.Event.EDITED event

I'm trying to stop the user in edit mode to don't overlap on other shape. In CREATED event, I can easily remove the layer. But in EDITED event I want to revert the shape back to original position ...
2
votes
0answers
121 views

Changing Leaflet Projection?

I am new to leaflet. I am trying to change Leaflet project to EPSG:32624 but it is not working. The map is not showing neither the marker. var crs = new L.Proj.CRS('EPSG:32634', '+proj=utm +...
2
votes
0answers
28 views

Caching tiles Leaflet 0.7.7

I've searched here as best as I could, and can't find a direct answer on how I could go about caching the map to speed up loading on zoom. It seems most caching options were introduced in 1.0.0 which ...
2
votes
0answers
431 views

Listen to a click event inside bindpopup with Leaflet

I'm using Leaflet, I have bound popups to layers, and created a popupopen event listener on the map as follow: map.on('popupopen', this._managePopUp.bind(this)); _managePopUp(layer) { ...
2
votes
0answers
178 views

Basic Authentication in Leaflet

I'm using Leaflet to display map tiles. The map tiles are loaded from a different site using basic authentication. So the url template looks like this: L.tileLayer('https://username:password@example....
2
votes
0answers
114 views

Leaflet zoom event direction

Is it possible to find out whether the user zooms in or out when using a Leaflet zoomstart or zoom event? map.on('zoomstart ', function() { console.log('I am zooming, but am I zooming in or out?'...
2
votes
0answers
130 views

Save Mapbox-Vector-Tiles (PBF) on indexeddb and use them offline

I'm developing a PWA(Progressive web app) where I need to retrieve PBF files from a POSTGIS database, then save them on an offline layer, to work as a offline-first app, right now I'm using a ...