Skip to main content

Questions tagged [leaflet]

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

860 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
34 votes
0 answers
3k 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 ...
Tom Chadwin's user avatar
  • 5,842
8 votes
0 answers
1k views

Controlling the visibility of a FeatureGroup in Folium with an HTML checkbox

I'm working on a project in Django where I want to show layers on a map by checking or unchecking boxes which I created using bootstrap. I am aware it is possible to use LayerControl to get these ...
Sigo van der Linde's user avatar
8 votes
0 answers
1k 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....
Elena Klimenko's user avatar
7 votes
0 answers
2k 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 ...
Jeremy Kidwell's user avatar
6 votes
0 answers
3k 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 ...
anonymous's user avatar
6 votes
0 answers
2k 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, ...
wambacher's user avatar
  • 311
5 votes
0 answers
2k 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....
Ast's user avatar
  • 51
4 votes
0 answers
257 views

Layer ordering of ST_ASMVT tiles in Leaflet

I am generating MVT tiles for multiple layers in Django using the following query: WITH bounds AS ( SELECT ST_Segmentize(ST_MakeEnvelope(8247861.100083642, 3551570.082242422, 8252753....
Arsh Doda's user avatar
  • 151
4 votes
0 answers
3k views

Cloud-Optimized GeoTIFF overlay on Leaflet?

I want to load external Cloud-Optimized GeoTIFF files onto a Leaflet map as overlays, and manipulate the colors based on user input. I've found examples online that appear to to this exact thing, but ...
DMack's user avatar
  • 655
4 votes
0 answers
927 views

How to develop responsive layer container in Leaflet?

I'm using leaflet.js to develop a drawing layer tool with the full-page map. Users will draw a group of layers to describe an industrial product's parts. The leaflet map and its layers should be fit ...
salihy's user avatar
  • 537
4 votes
0 answers
2k 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, ...
Mr.Code's user avatar
  • 313
4 votes
0 answers
3k 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?'...
BritishSteel's user avatar
  • 6,647
4 votes
0 answers
3k views

Save Leaflet drawn features with attributes to PostGIS

Goal: In order to have a fully interactive map, I would like to be able to save some drawn features (in a second step with some attributes that may be grabbed through an input mask form or pop-up) on ...
swiss_knight's user avatar
  • 10.3k
4 votes
0 answers
329 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 ...
ViktorG's user avatar
  • 159
4 votes
0 answers
2k 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 ...
weiji14's user avatar
  • 1,751
4 votes
0 answers
404 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 ...
himanshu jain's user avatar
4 votes
0 answers
3k 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 ...
user3103373's user avatar
3 votes
0 answers
363 views

Mbtiles to plot in map using react-leaflet

I am new to map technology and I am using react-leaflet to plot GEOJSON to map. It was all going well but then I m facing load time with massive GeoJSON data, so need to convert GeoJSON to mbtiles. ...
Silen's user avatar
  • 31
3 votes
1 answer
1k views

How can I get to the updated coordinates from edited L.polygon?

There is a polygon come from api and I need to update coordinates with edit layer by angular-draw leaflet. Here is the html, <div style="height: 100vh;" leaflet leafletDraw ...
Nil's user avatar
  • 39
3 votes
0 answers
1k views

Hatch polygons in Leaflet

I need to hatch polygons (loaded from a GeoJSON) in a leaflet webmap. Until now I have this: //Style of each polygon function style(feature){ return { opacity : 1, color: 'black', ...
Cliff's user avatar
  • 129
3 votes
0 answers
104 views

Disabling checkbox in layers list while exporting in qgis2web

Is there a possibility to disable the checkbox on certain layers in the layers list (Leaflet export)? I found something similar already here: qgis2web - show specific layers in layer list but ...
fomofahg's user avatar
3 votes
1 answer
836 views

Dynamically changing fillColor variables in leaflet

When I want to style a polygon using a property the traditional way is to assign a function that returns a style object. Within that object you assign the fillColor property to a getColor function ...
Andrewchi's user avatar
3 votes
0 answers
1k views

Add a legend to Leaflet map

I am trying to add a legend in Leaflet based on a GeoJSON layer like this: This is my code: L.geoJson(Viales_Transitables).addTo(map); var Viales_TransitablesStyle = { ...
ZoneGIS's user avatar
  • 31
3 votes
1 answer
274 views

GeoJSON file content not display properly in Leaflet

I am new to Leaflet. Am facing one issue when try to display GeoJSON file in Leaflet. Issue: Actually some GeoJSON file only am facing this problem. In my knowledge coordinates are in different ...
Ram prasad's user avatar
3 votes
0 answers
5k views

Large GeoJSON file in Leaflet performance issue

I have a large GeoJSON file (now it is about 22MB with 4K polygons but it is going to contains about 10k polygons) I load the file in Leaflet using L.GeoJSON.AJAX, on each feature I attach two ...
Cenere Blu's user avatar
3 votes
1 answer
1k views

Creating popups in Folium (Leaflet) for GeoJSON polygon layer

Looking through the Folium documentation I can't find how to add a popup to a polygon GeoJSON layer in Folium. Looking through the Leaflet documentation it seems like its possible, but I don't know ...
Ethan Goss's user avatar
3 votes
0 answers
1k 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:\\...
Stupid_Intern's user avatar
3 votes
0 answers
256 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. ...
pascatl's user avatar
  • 1,079
3 votes
0 answers
6k 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....
user2740509's user avatar
3 votes
0 answers
877 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 ...
Ankita.DBG's user avatar
3 votes
0 answers
2k views

How to change the layer selection view from Radio button to Image in Leaflet

I have implemented the below example to show the multiple base layers of map in my application using LeafletJs. Leaflet JS LayerGroup example I'm able to successfully implement the same but I'm ...
The JOKER's user avatar
  • 131
3 votes
0 answers
297 views

Extend / override Mapbox-gl 'baselayer' loadTile

Similar to how Leaflet's guide shows how to override L.TileLayer's getTileUrl method in place of your own (and L.GridLayer's createTile method), I want to know how to extend/override Mapbox-gl's ...
Alex's user avatar
  • 131
3 votes
0 answers
1k 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"; }; ...
Nylak's user avatar
  • 143
3 votes
0 answers
2k views

Leaflet Draw: edit/delete features of different layers

I use Leaflet Draw and Leaflet WFST plugins to create/edit features and save my edits to PostGIS Database (hosted by GeoServer). I have three layers: points, lines, and polygons. I manage to make new ...
Elena Klimenko's user avatar
3 votes
2 answers
3k 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....
xenia's user avatar
  • 31
3 votes
0 answers
4k views

Vector Tiles VS Raster Tiles for leaflet

I have downloaded many vector tiles in the mbtiles format from OpenMapTiles. The reason I did that is because I will be using them on a station that cannot have an internet connection at all. I would ...
LBes's user avatar
  • 163
3 votes
0 answers
2k 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 ...
Henry Dark's user avatar
3 votes
0 answers
530 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 ...
kykong's user avatar
  • 93
3 votes
0 answers
2k views

get Layer Id of a specific Marker

I have polygons represented in Leaflet. Then I added some markers over these Polygons. var = customMarker = L.Marker.extend({ options:{ Layer: '' }}); I extended marker to store the ...
zahma's user avatar
  • 141
3 votes
0 answers
293 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', '+...
wfgeo's user avatar
  • 3,558
3 votes
0 answers
292 views

Marker click listener jsf2leaf

I am using jsf2leaf library to add a map to a web application using primefaces. The map and the markers(popup message when clicked) are displayed correctly, however I want to display a primefaces ...
DarkSide's user avatar
3 votes
0 answers
1k 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 ...
Adam's user avatar
  • 31
3 votes
0 answers
145 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 ...
Arun Govind's user avatar
3 votes
0 answers
360 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 ...
Syb Ille's user avatar
3 votes
0 answers
243 views

Which Leaflet Basemap with shaded relief should I use for a WebGIS?

I'm having difficulties to show shaded relief in our Basemap. Where can I find a free and clean basemap service, that shows only shaded relief? With no labels, no roads, no rivers, no cities, etc., ...
eduardosteps's user avatar
3 votes
0 answers
2k 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 ...
tjmgis's user avatar
  • 3,330
3 votes
0 answers
952 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 ...
Cambs.Insight's user avatar
3 votes
0 answers
451 views

Draw raster on top of a Leaflet map

I want to implement a raster layer on top of a Leaflet map that includes the following functionalities: Digital Elevation Model (DEM) terrain height included in each raster cell GPS-Track (I use this ...
Alexejevitsch's user avatar
3 votes
0 answers
791 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 ...
JoeyJoeJoe's user avatar
3 votes
0 answers
327 views

Leaflet Temporal animation of marker clusters

I recently have applied the markercluster leaflet plug-in to my map and I was wondering if something like leaflet.timeline would be compatible with cluster visualization? if not is there any other ...
Diffusion_net's user avatar

1
2 3 4 5
18