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

12
votes
0answers
885 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
109 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
951 views

Styling Geoserver pbf vector tiles in Leaflet

I'm serving up vector tiles in pbf format in Geoserver 2.11.2 (using the MVT extension) and consuming them in Leaflet 1.2.0 with Leaflet.VectorGrid 1.2.0 but am having trouble styling them. The URL ...
4
votes
0answers
555 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
637 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
636 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
232 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
98 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
264 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
831 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
346 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
318 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
69 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
83 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
145 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
469 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
99 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
228 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
500 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
426 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
434 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
508 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
127 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
491 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
516 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
590 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
587 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
655 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
307 views

What is wrong with my data receiving from php script for geoJSON TileLayer?

I want to get geo data as geojson for geojson tile layer requests in leaflet. I set up a geojson layer like this: https://github.com/glenrobertson/leaflet-tilelayer-geojson/ A php script answers ...
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
654 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
437 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
647 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
24 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
91 views

GeoJSON to Leaflet map using Django template

I have a view that returns this GeoJSON data {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[-74.6739518440393, 40.7747050657312], [-...
2
votes
0answers
23 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
217 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
124 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
71 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
88 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 ...
2
votes
0answers
137 views

Lucene Like Search engine for leaflet

I need to search my geojson file by its feature properties (which were fields on the csv file before I converted it). I found this search plugin but it doesn't meet my needs. I need a search engine ...
2
votes
0answers
81 views

Reprojecting EPSG:5514 to EPSG:3857 for use in Leaflet

I have one JPG (170 MB) and JGW file of a small area projected in EPSG:5514 (Image provider told me.) JGW file: 0.1250000 0.0000000 0.0000000 ...
2
votes
0answers
95 views

Update multiple leaflet locations if value

i have a vehicle tracking api that I am attempting to consume in leaflet. My idea is that is the vehicle driving value is true, then update the location. Ideally, it would be if the location is ...