Questions tagged [leaflet]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
6 views

How can I use custom style from MapBox with leaflet L.vectorGrid.protobuf

I have a custom style, that I made in MapBox. I don't have it in a digital version. How can I use it with leaflet? From here I understand how to add it. But I still need to apply styles. From this ...
17
votes
1answer
44k 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 ...
2
votes
1answer
33 views

How to get Leaflet map.hasLayer(label) instead of map.hasLayer(layer)

I want to get label of the layer selected in option control in order to know which thematic analysis to run. because I have just one layer, but different fillcolor regarding the label in the list ...
2
votes
1answer
674 views

Leaflet JS - open popup on button click

New to JavaScript, coming from Python background. Created a custom control and have added buttons inside the _div using a for loop and innerHTML. I want to zoom to and open the popup of a layer of ...
0
votes
1answer
40 views

Avoid overwriting the style of a marked cell in Leaflet & Javascript

I have a system where I mark cells with different colours if a geoposition has been obtained within a cell. My issue is that due to the continuous update of geopositions, cells that were marked with ...
1
vote
0answers
44 views

Limit API request to zoomed bbox

I am working on a forked OSM/leaflet/overpass API application which has its own max bounds declared var mapBounds = { south: 50.8025, west: 0.3724, north: 50.8785, east: 0.5290 }; var LBounds = L....
1
vote
0answers
18 views

Bounding box in Leaflet

I am currently writing a app in R / Shiny where I use Leaflet. Background layers are WMS and it works fine for most services without specifying any projection anywhere. When using fiddler I see that ...
1
vote
0answers
22 views

How can I get the latitude and longitude bounds of a tile set from MapTiler using leaflet.vectorgrid?

I have a leaflet map that loads a vector tile set from Maptiler. I would like the map to fit the bounds of the tile set's content when the user selects the overlay check box to display this tile set. ...
1
vote
0answers
37 views

Using Leaflet.VectorGrid with local GeoJSON and addLayer

I am trying to test out Leaflet.VectorGrid from https://github.com/Leaflet/Leaflet.VectorGrid. My overall goal is to load a large 20MB or larger geojson quickly. I am getting this error... "...
1
vote
0answers
17 views

Adding a popup to features in a leaflet.vectorgrid layer

I am loading a tile set from MapTiler to my leaflet map. I have no trouble styling each feature in the tile set. I can set each feature to the appropriate color. I would like to also add a popup to ...
2
votes
2answers
38 views

Styling polygons in a map tile PBF file in Leaflet

How can I dynamically add data to a pbf file generated by Maptiler? I created a pbf file with the MapTiler desktop application. I started with a geojson file containing polygon geometries. My file is ...
9
votes
3answers
8k views

Merge geojson polygons with WGS84 coordinate

I have a Geojson file with some adjacent polygons and I want to merge them into one. I know it's a recurrent question but I can't find information for polygons with latitude and longitude coordinates ...
0
votes
0answers
29 views

Using EPSG:2169 with Leaflet [closed]

I'm trying to use Leaflet with a specific projection EPSG:2169 (Luref, or Luxembourg). I saw that if I don't use a "standard" projection like WGS84, I have to use Proj4Leaflet and reference it to the ...
0
votes
0answers
44 views

What CRS should be standard for a group with many QGIS Projects? [closed]

A group of us are gathering geospatial data for analysis and later interactive web maps. I am hoping to standardize the CRS across QGIS projects. Data will be coming in from Google MyMaps as a .kmz or ...
0
votes
2answers
210 views

Leaflet GeoJSON map legend

I am struggling with creation of the map legend adequate to my GeoJSON stylization. The code looks like below: var geojsonMarkerOptions = { radius: 8, fillColor: "#ff7800", color: "#000", weight: 1, ...
1
vote
1answer
21 views

Map is not visible at initialization using react-leaflet

I have this react component: import React, { Fragment } from 'react'; import L from 'leaflet'; import { Map, TileLayer, Marker, Popup } from 'react-leaflet'; import 'leaflet/dist/leaflet.css'; const ...
1
vote
2answers
464 views

Add points on zoom and remove points when zooming out

Problem I would like to add points/shelterIcons when zooming to level 12 or more and remove them again when zooming out. If all the points were defined as a layer I could add/remove them with the ...
0
votes
0answers
35 views

Deploying a GeoDjango project with Apache web server (on Windows system)

I am a newby in deploying web application. I have done a little web-gis app using Django in PyCharm and utilizing Osgeo libraries and drivers with Python37. I have deployed the web server using ...
1
vote
0answers
31 views

Render map data faster in Leaflet using MapTiler

I have a Vuejs app containing a Leaflet map that displays GeoJSON files. Some of these files, such as the file containing polygons for all zip codes in a US state are very large and load too slowly. ...
1
vote
2answers
373 views

Overriding default popup anchor in Leaflet GeoJSON polygon?

By default popups open wherever you click within the boundaries of polygons in Leaflet geojson layers. Here's an example: JsFiddle I would like to anchor the popup either: so it opens in a specific ...
0
votes
2answers
488 views

Projection (Datum?) slightly off for plotting Geopandas [closed]

I'm trying to plot some polygons I obtained from a 2002 Census in Chile. I'm loading them to geopandas, converting them to epsg='4326' and then sending them to Folium (which is a wrapper for Leaflet). ...
0
votes
1answer
100 views

Checking if a specific leaflet.draw control is enabled?

Where exactly are the leaflet controls stored that are added to the map? So at anytime in the app, I can check something like if(controls.polyline.enabled==true) My guess is its somewhere in the map....
1
vote
1answer
614 views

Adding a position.watch and update feature to live map with leaflet.js?

I have an app working in node.js that locates a user and plots their location on a leaflet map. When others connect it shows them too. It keeps their marker live as long as they move the mouse. I ...
0
votes
1answer
87 views

White sides at marker popup

I like Leaflet a lot. But I want to ask how to remove white sides in the popup? I manage to turn of padding but it only removed top and bottom, but sides still stand. I will insert a image and it will ...
0
votes
1answer
64 views

Integrate Leaflet / OpenStreetMap autocomplete functionality to an existing search form on a WordPress template

I am trying to add the autocomplete functionality similar to what you have here https://community.algolia.com/places/examples.html#advanced to the search form in my website. Unfortunately there are no ...
3
votes
1answer
58 views

Specify an alternative URL for a “tileLayer” to use in Leaflet?

Let's say I have a: var myTileLayer = L.tileLayer('https://{s}.tile.SomeMapServer.com/{z}/{x}/{y}.png'); and if some tiles fail to load, I want them to be loaded from 'https://{s}.tile....
0
votes
2answers
3k views

Making Leaflet image overlay draggable? [closed]

I simply want to make a georeferenced imageOverlay draggable in leaflet. I found several unanswered posts (e.g. here and here). Since it is easy to make markers draggable, someone tried to adapt the ...
0
votes
1answer
37 views

How to get attribute data based on the GeoJSON you clicked Leaflet?

I'm trying to pull the attribute data from a GeoJSON layer. var neighLyr = new L.GeoJSON.AJAX("data/neighbourhood.geojson",{ }).addTo(mymap); neighLyr.on('click', function (e) { console.log(...
0
votes
1answer
595 views

Creating layers depending on a property?

I have a .js file with coordinates for internships: var internships = [{ "features": [ {"type":"Feature","properties":{"category":"entretient","Name":"green"},"geometry":{"type":"Point","...
2
votes
1answer
1k views

Combine multiple dynamic Leaflet filters

I'm very new to Leaflet and made a map using a GeoJSON Layer. I'd like to filter points from the GeoJSON Layer by a checkbox input. If I consider only one Parameter (Par1) with levels A, B and C I can ...
3
votes
0answers
41 views

What is tilde (~) for in R? [closed]

I know this is an almost too simple question. But maybe there is a fast answer. Looking through some code to build a leaflet map in R I found that part of code: mypal = colorNumeric( palette = "...
1
vote
1answer
39 views

Understanding theMap.on('click') event of Leaflet [closed]

I inherited code from another person and some of the lines are as follows: theMap.on('click', function(e) { minx = (e.latlng.lng - 0.0000001).toFixed(7); miny = (e.latlng.lat - ...
1
vote
1answer
116 views

refreshClusters on esri.Cluster.featureLayer

I am trying to 'refresh' a cluster layer which is created by L.esri.Cluster.featureLayer and a feature url. I have tried to remove and re-add the layer (with no succees). But the refreshClusters is ...
9
votes
2answers
22k views

Leaflet: how to use a custom marker on a geojson layer?

I'm trying to put on a Leaflet map a geojson and all works fine until I use the default blu marker. Now I'd like to use a custom marker (a little .png icon) and I've changed my code in the follow ...
0
votes
0answers
27 views

Disable scroll wheel zoom event in Leaflet for R

Is there a way to disable scroll wheel zoom events for Leaflet in R, when you do not know what the zoom is in advance? output$map <- renderLeaflet({ location <- input$location_id lf_bbox &...
0
votes
1answer
173 views

Second layer from data getting ignored on Leaflet map, and bounds not found

I've been breaking my head over a simple generalization of the combination of several Leaflet examples: Make a polyline between markers, But use Leaflet.MarkerCluster as we may have multiple in ...
0
votes
0answers
27 views

Make a draw object option in Leaflet and that stores it in the webmap in a database or on a server

I would like to set up a simple web map which should be used as an information for those out in the field that needs to show something immediately. So I would just load the web map and get an overview....
0
votes
2answers
29 views

Leaflet Feature bindpopup does not display (OnEachFeature)

I am attempting to have a click event popup with some data pulled from Wikipedia and displayed on my Leaflet map for each point that displays GeoJSON data. My data is displayed on map as you can see ...
1
vote
1answer
37 views

Are searchable maps limited to geocoding APIs like Google

My client wants a searchable map. I'd like to use Leaflet and Mapbox for the map, but is having an address-search feature limited to geocoding APIs like Google Maps or Mapquest?
1
vote
1answer
25 views

How can I prevent a marker being dropped when the map is dragged in Leaflet?

I am using Leaflet to display a map in Angular8. I want to add a marker to the clicked location. Everything works fine, except the fact that a marker is being added after I finish dragging the map, ...
0
votes
0answers
32 views

Displaying projection with IMSHOW()

I am having an issue displaying satellite data on the correctly projection using cartopy and imshow. I am unsure of the initial data projection, but I am trying to put it into Plate Carree with a ...
1
vote
1answer
26 views

How can I find LayerGroup for a given object in Leaflet?

So, I have a LayerGroup with polylines, points, etc. in some Layers. A certain Polyline has the handler: Polyline.on('click', lineHelper); Can I find out in this handler which LayerGroup the ...
1
vote
1answer
19 views

mapfish.print.InvalidValueException: url has an invalid value

I have the config yaml set us below: - !image maxwidth: 120 maxheight: 40 align: left url: "file:\\C:\Program Files (...
2
votes
2answers
119 views

SAS Planet cached tiles for use in Leaflet map

I downloaded some tiles from ArcGIS.Imagery with SAS Planet The tiles is in folders like ArcGIS.Imagery/z2/0/x1/0/y2.jpg ArcGIS.Imagery/z13/2/x2624/1/y1750.jpg And I use this TileLayer to display ...
2
votes
1answer
153 views

Leaflet info box only showing properties from selected layer

I would like to use the info box as shown in the tutorial interactive choropleth map with multiple layers and properties from different layers. The idea is to only show the properties from the ...
0
votes
1answer
368 views

Custom functions for SAVE and CANCEL on Leaflet.draw edit control

I have added an edit control on my map which is working fine (On the Frontend); var editControls = new L.Control.Draw({ draw: false, edit: { featureGroup: this.updateGeomLyr ...
1
vote
2answers
1k views

Coloring circleMarkers based on category in Leaflet?

My question is, how can I get Leaflet to color each of circleMarkers I am generating/points with a different color, based off the type property of the point? I've done a bit of research, but all I've ...
1
vote
1answer
26 views

Adding hyperlink in a popup which comes from a polygon?

I need to add a hyperlink in a popup which comes from a polygon. The following piece of script shows the text which needs to be a link. var polygon = L.polygon([ [51.569, -4.144], [51.568, -4.145], [...
-1
votes
0answers
9 views

Web mapping using GeoJSON file with Leaflet [duplicate]

How can I start web mapping using Leaflet using a GeoJSON file. I really don't know how to go about it.
0
votes
0answers
24 views

GeoServer To Vue2-leaflet projection issue

I am using GeoServer (using Tomcat in localhost) and to send a WMS file to my Vue2-leaflet application. My projection in GeoServer is ESPG 4326 This is my Leaflet code : <template> <...