Questions tagged [leaflet]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
22 views

Leaflet kmz stops loading other kmz files if gets XHR 404 while fetching remote file in any one of kmz's

Referring to https://github.com/Raruto/leaflet-kmz Here is my leafllet kmz code: <script> var map = L.map('map', { preferCanvas: true // recommended when loading large layers. }); map....
0
votes
0answers
15 views

Building an offline tile server for ESRI World Imagery

I have a JavaScript and Leaflet project which serves users OSM and ESRI maps offline. I have 2 map layers. I successfully built the OSM part with switch2osm tutorial. But I couldn't find the similar ...
1
vote
1answer
25 views

Error when setting “permanent” tooltip option with bindtooltip in Leaflet

I've got a geoJSON that I load into a map and add tooltips to. Pretty simple, figured that out fine, and now I want the tooltips to be permanent (displayed on map load instead of on marker hover), and ...
0
votes
0answers
23 views

Convert KML files to vector tiles or images and show them on open street map

I am using Leaflet KML plugin as below: https://github.com/windycom/leaflet-kml Here is full code: <html> <head> <meta name="viewport" content="width=device-width, ...
1
vote
2answers
32 views

Removing individual Leaflet markers added through L.geoJSON

I'd like to click on a button in a sidebar outside a Leaflet map and remove a marker associated with that button. But when I bulk add data through L.geoJSON, the function appears to not create ...
0
votes
2answers
48 views

Get a list of leaflet marker clusters within current map bounds in Leaflet

I am using leaflet.markercluster plugin to show clusters on my map and getting information about each cluster on hover/click event. What I'd like to do now is to write a method that if a user zooms or ...
0
votes
0answers
13 views

How to show a single polygon on react-leaflet as I am able to draw the whole shapefile data on React Leaflet

I am Using React Leaflet for showing some GeoJSON data and I have successfully added geojson layer to react leaflet with . That GeoJSON layer contains a shapefile with polygons and multipolygons. Now ...
2
votes
0answers
32 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 = { ...
2
votes
1answer
29 views

Remove the last item from feature group in Leaflet

I just need to delete the last item in a featuregroup. This code gives me that I have TWO objects in in the featureGroup featRouteL: console.log("so many objects: "+featRouteL.getLayers()....
1
vote
1answer
25 views

Expanding or extending the options or params for tileLayer

So I am using the side-by-side plugin on this repository https://github.com/digidem/leaflet-side-by-side. It allows me to add two different tile layers to the map and splits the screen in two. However,...
0
votes
0answers
18 views

Adding a GeoJSON layer to WebGL Earth

How can I overlay the country shapes from this Leaflet example onto a WebGL Earth globe? I've tried replacing geojson = L.geoJson(euCountries).addTo(map); with geojson = WE.geoJson(euCountries).addTo(...
1
vote
0answers
23 views

{z}/{x}/{y} tiles for Belgium names only

Right now I have a leaflet map, with GEOJSON layers rendered on top of them, behind that I render {z}/{x}/{y} tiles that only displays names of countries, cities, and so on. The thing is, that ...
0
votes
0answers
24 views

How do I create more makers with more unique popups?

I am attempting to create a map with Leaflet that has unique files attached to different popups. I can generate a marker with the popups I want but I can not generate a second marker with different ...
0
votes
0answers
20 views

Leaflet only allows polygon layer from GeoJSON to be displayed one time

I have used an AJAX call to load a Black Sea GeoJSON that I want to display as a polygon on the map. var blackSea = []; var blackSeaData = new L.GeoJSON.AJAX("./blacksea.json"); blackSea....
0
votes
1answer
21 views

Paths not matching on map, while they do in illustrator

I'm quite of a newcomer when it comes to mapdata. I have an illustrator map, drawn by ourself, with diffrent polygons (regions, country, ...). In Illustrator I know 100% that the region and country ...
1
vote
1answer
80 views

Change GeoJSON file based on user input

I am very new to web development and creating maps using Leaflet. Currently I developed a website that has an interactive map based off this tutorial. The map eventually loads and works but it is very ...
0
votes
1answer
50 views

Creating polygon GeoJSON from PostGIS and rendering in Leaflet

Drawing the polygons on QGIS and then import the layer directly on the PostgreSQL / PostGIS db. Then I create a JSON file via PHP and read it to the Leaflet. Everything works but zooming I see a lot ...
-1
votes
0answers
26 views

Drawing polygon from coordinates in URL

I have a bunch of polygon coordinates in a KML format. What I want to do is to generate links from them to open (with OSM data). Can be an existing service or something like Leaflet that I can put on ...
1
vote
1answer
26 views

Assign Markers to Polygons in Leaflet

I want to visualize polygons in Leaflet. I do this via L.geoJson, no problem here. But each polygon shall has it's own set of Markers, which should be dispayed, when the polygon is clicked and hidden, ...
1
vote
1answer
75 views

Leaflet map with D3.js dynamic graph from geojson data

I build a Leaflet map and display data from a GeoJSON. I add a Leaflet-Sidebar to my map, and embed the info control inside this sidebar. When a user hovering polygons on the map, raw values are ...
1
vote
2answers
33 views

Adding Corine WMS to Shiny Leaflet

I'm trying to add Corine land cover data to a shiny leaflet map. However, I'm struggling to decipher the WMS XML data so that I can include the appropriate server URL and layer. The WMS information ...
3
votes
1answer
47 views

Call different functions when clicking on a map vs. clicking on a polygon in Leaflet

I have a map and I add a featureGroup to it. Then, I add some polygons to the featureGroup. Now I want something to happen, when a polygon in featureGroup is clicked and something else to happen when ...
0
votes
0answers
12 views

Lealfet spin path in a Django application

I work with Django and Leaflet to create maps applications. I can display a Leaflet map and load data from a GEOJSON. While this GEOJON is loading I wan't to display a spinner. I used bower to install ...
0
votes
0answers
26 views

Updating folium changed the outlook of Popup box

Recently I updated folium and noticed some changes to the popup box. With the new update the popup box seem to have shrinked and the text is coming in separate lines, which should have appear in the ...
0
votes
0answers
22 views

Remove all the labels from my OpenMapTiles Server

I have setup my own OpenMapTiles Server. I have downloaded the whole Asia region. I'm using Leaflet to fetch the tiles. I want to remove all labels from the map. I can make changes on the server or my ...
0
votes
0answers
80 views

Display GeoJSON data on a Leaflet map with a Django app

I wan't to display GeoJSON data on a Leaflet map using Django. Data is from a PostgreSQL database, I have created a view with raw JSON which returns me data but I wan't to add this to a Leaflet map as ...
0
votes
1answer
31 views

What routing system support off-road routing for Leaflet integration?

I have a collection of regionally specific linestrings and multi-line strings which are off-road paths. I would like to be able to integrate these into a Leaflet routing systems which would ...
1
vote
1answer
38 views

Using circleMarker with mouseOver in Leaflet

I am working from the example at Highlighting feature by Id with Leaflet. I wanted to change the appearance of the point layer by using circleMarkers, but now the script (who was supposed to highlight ...
0
votes
1answer
35 views

Error with Leaflet- Search Plugin - GeoJSON Data

I have this error with the Leaflet- Search Plugin. I get the following the error. Uncaught TypeError: this._layer.addTo is not a function search 2.9.8/dist/leaflet-search.src.min.js:7 search 2....
0
votes
1answer
32 views

Regular-grid-cluster plugin for Leaflet

I am starting with Leaflet and I am trying to use the Regular-grid-cluster plugin with no success. The following code works until the definition of the 'const grid' element. So, I can see the markers ...
0
votes
1answer
74 views

Routing Layer does not show on Leaflet Map

I am trying to develop a routing application. I have published my layers and SQL view on GeoServer. Currently I am trying to display my pgRouting Layer on my leaflet map using markers as start and end ...
0
votes
1answer
33 views

Enable dragging on leaflet map for popup div within map

I'm sorry for my English, I just study it. Is it possible to save map-draggable functionality on popup within leaflet map? I mean move the map while dragging(clicking and moving or tuching on mobile) ...
1
vote
0answers
30 views

leaflet-kml loads entire KML of 15-20 MB at client browser in one go or in chunks as and when user drags to other locations of country?

I am trying Leaflet KML plugin as below: https://github.com/windycom/leaflet-kml Here is full code: <html> <head> <meta name="viewport" content="width=device-width, ...
0
votes
0answers
21 views

leaflet-kml Lat Lng changes and zoom don't work with KML

I am trying Leaflet KML plugin as below: https://github.com/windycom/leaflet-kml const map = new L.Map('map', { center: new L.LatLng(28.412, 77.317), zoom: 11 }); It works, loads the KML over OSM, ...
0
votes
0answers
44 views

Control layers with slider in Leaflet

I wish to control the displaying of tms overlays with just a slider. Until now, I was adding all of my layers in the map like this var googleHybrid = L.tileLayer('http://{s}.google.com/vt/...
0
votes
0answers
13 views

Is there a way to use arbitrary, non “plugin” libraries inside Folium / JupyterLab?

It appears Folium supports certain plugins through folium.plugins Is it possible to use an arbitrary third-party library in Folium / JupyterLab? I want to use sidebar-v2. I know I can generate a map ...
1
vote
1answer
26 views

Viewing cached data with GeoWebCache?

var map = L.map('map').setView([55.42, 53.50], 6); var wmts = L.tileLayer('C:/Program Files(x86)/GeoServer 2.15.1/data_dir/gwc/web/{z}/{x}/{y}.png', { wmts: true, }); wmts.addTo(map); The data I ...
1
vote
1answer
23 views

Extract coordinate values from Leaflet marker to Java Script variable

I am trying to incorporate pgRouting layer from geoserver to my HTML GUI. For this I have been trying to make a function that will take coordinate values from a Leaflet marker and feed them into my ...
1
vote
1answer
27 views

Filter Leaflet markers by input selectionin R Flexdashboard

I am trying to filter the markers that are drawn on a Leaflet map based on what is selected in a user defined date range. The below codes is returning an error that it is unable to find hfxLoc object. ...
1
vote
0answers
22 views

Leaflet, Rails 6 and Ajax. Simple marker rendering. Code review requested [migrated]

i am trying to render in a leaflet map that should render a single marker. I am building the JavaScript as follows. build the map, an even listener for when the user opens the page where the map is ...
1
vote
0answers
18 views

How to store lat lng to a file Leaflet? [closed]

<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="stylesheet" href="...
0
votes
1answer
33 views

Geoserver parameterized SQL View layer vs. SQL View layer with WMS time dimension. Any differences in speed?

I have two PostGIS tables, cities (city_code and geometry column) and precip (city_code, date, precip). The precip table can have more than one entry for each city since I have a precipitarion time ...
0
votes
0answers
23 views

Make Leaflet MarkerClusters stay open all the time

I use the Leaflet MarkerCluster plugin and when clustering is clicked, previous clustering closes, how can I solve this? How can I keep it open, no matter which cluster is clicked?
1
vote
0answers
44 views

Applying specific styling to GeoJSON layer in Leaflet.js

I am new to Leaflet.js and I would like to apply specific styling to the Geojson layer> This is my code so far: # geojson data var geojson = { "type": "FeatureCollection", &...
1
vote
1answer
51 views

Highlighting feature by Id with Leaflet

I cannot work out the solution given in Leaflet highlight feature by ID. I have the script below which adds a layer "commercial" and a layer "sector". What I want is that when I ...
0
votes
0answers
45 views

className of leaflet popup option does not apply to the intended DOM element

I have a problem similar to this post. Basically, the CSS is not applying to the element I am trying to target, and I cannot see why not: /* css file: */ .sitePopUp .leaflet-popup-content-wrapper{ ...
0
votes
0answers
16 views

R Leaflet: Assign multiple groups to a layer to filter data and change column represented

I am trying to find a way in R leaflet to include overlay buttons which filters out groups in the data. I also need to include radio buttons which switch the column which is being represented in the ...
0
votes
1answer
52 views

Different Leaflet / Folium markers for different zoom levels?

I'd like to use, say, a circle or map pin when zoomed out, and for this to change to a polygon / shapefile when zoomed in (specifying the zoom level at which the change occurs). Can Leaflet do this?
0
votes
0answers
37 views

How to create a Legend with Points. Same size in Legend and Map. Leaflet

I am trying to create a Legend in Leaflet that contains the circles in the map. But, the size in the legend should the same size that it is in the map. My code is next. function getRadius(pop) { var ...
0
votes
0answers
36 views

Leaflet polygon labels not showing when pathOptions(clickable = FALSE)

I am creating a Shiny app which contains a Leaflet map. The purpose of the map is to select a polygon by clicking on the map, and then to draw a choropleth of results for the selected polygon. ...

1
2 3 4 5
67