Stack Exchange Network

Stack Exchange network consists of 175 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

17
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
238 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
674 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
706 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
710 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
242 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
55 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
92 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
248 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
548 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
2k 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
434 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
403 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
155 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
123 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
222 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
645 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
120 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
256 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
701 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
537 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
584 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
583 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
115 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
143 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
547 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
561 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
686 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
622 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
712 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
683 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
443 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
3k 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
671 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

Plotting KML data on Leaflet map

I have 5 different KML files for each subzone of Singapore map. I want to plot the KML data by subzone on a Leaflet map. library(leaflet) library(raster) library(readxl) library(rgdal) setwd("F:\\...
2
votes
0answers
33 views

Use leaflet-draw-toolbar with angular 2

Is it possible to use leaflet-draw-toolbar with angular 2 and ngx-leaflet-draw? I do not see, and I am not versed in Angular 2, enough, to incorporate the JS library for leaflet-draw-toolbar into my ...
2
votes
0answers
271 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
33 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
64 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
169 views

PostGIS - Dynamic Server-Side Clustering based on Zoom level

I'm working on a Ruby on Rails application that is showing road signs on the map(leaflet). So, user can browse map and road signs, great. But, if there are a lot of signs and user wants to zoom out, ...
2
votes
0answers
39 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
741 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
173 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
181 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
168 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 ...