Questions tagged [leaflet]

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

Filter by
Sorted by
Tagged with
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 ...
1
vote
1answer
894 views

L.control.sidebar is not a function

I have install leaflet-sidebar-v2 via npm. However when I try to simply initialize the side bar I get this error. L.Control.Sidebar is not a function. here is my index.html import scripts etc &...
1
vote
1answer
206 views

Change Ordering of features within one layer in leaflet

My Question is exactly the same as mentioned in this Question The main difference is that I can't use bringToFront() because I have points inside the highlighted polygon that I want to show a tooltip ...
0
votes
1answer
887 views

input data coordinates to database from input data inside leaflet js

i have a problem with my update data coordinates form leaflet popup. i just want to make edit form inside leaflet popup. if i click marker in a map it shown coordinate with input form, if the building ...
0
votes
0answers
27 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
27 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
43 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....
1
vote
2answers
60 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 ...
1
vote
1answer
157 views

Incorporating Ordnance Survey map with other layers in Leaflet

I am trying to incorporate the Ordnance Survey layer into my Leaflet map. The goal is to enable it as another map layer amidst a few existing ones. One of the code looks like this: var link = L....
0
votes
1answer
44 views

Mousehover placemark in Leaflet

I am trying to make my GeoJSON placemark hovered in Leaflet. Basically the pop up exist and I don't want to change it. What I would achieve is only change it color, when hovered by mouse. I was trying ...
1
vote
2answers
172 views

Stop Leaflet event propagation?

I have a feature layer and some pins on it, with mouseout, mouseover events callbacks on the feature. When the mouse is over the pin icon, that triggers mouseout event (mouseout from the feature layer)...
1
vote
1answer
173 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
1answer
93 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
244 views

Layer.bindTooltip doesn't work in Leaflet

My objective is to plot polygons and assign a tooltip label to each one. For some reason, my code doesn't seems to work. poly_geojson = L.geoJson(poly_gon,{ onEachFeature(feature, layer) { ...
3
votes
1answer
55 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
1answer
37 views

Cannot load tiles from Mapbox using leaflet.js

I am a new user and I can't seem to get the tiles on the map. var mymap = L.map('mapid').setView([51.512, -0.104], 1); L.tileLayer('https://api.mapbox.com/styles/v1/mapbox/{mapbox.mapbox-streets-v8}/...
1
vote
2answers
407 views

Display .kml file in Leaflet

I would like to show my .kml file in my leaflet map.~ There is a plugin: https://github.com/windycom/leaflet-kml whixh unfortunately doesn't work. It show only a blank map in the coordinates provided....
2
votes
2answers
497 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], [-...
0
votes
0answers
17 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
28 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
1answer
663 views

Edit a shapefile with Leaflet.pm

I am new to Leaflet but so far so good. I managed to add the plugins I needed and they work. Except the shapefile editing. I am using leaflet.pm to draw, snap, cut polygons (only polygons). I also ...
0
votes
0answers
25 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 ...
1
vote
1answer
28 views

How to set the same size between GeoServer and Leaflet?

The right Map is a layer from GeoServer (I set the CRS as 4326) in the left is the result of the Leaflet code (here a linked the GeoServer layer to publish in the leaflet map), as you can see in the ...
0
votes
1answer
101 views

How do I adapt existing responsive web site to display Leaflet maps?

My website works well on different devices but it seems that only works with images, although I would like to show other media, like Leaflet maps and videos. Just about all pages are laid out on a ...
24
votes
0answers
2k 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 ...
0
votes
1answer
74 views

The position and size of my Tile Map is incorrect when it is displayed in React-Leaflet

I converted the GeoTIFF file to a tiles map. I'd like to display it in react-leaflet, but the size and position are not right. What can I do to fix it? This is condition when displayed. (overlaid on ...
0
votes
1answer
90 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
0answers
171 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 ...
1
vote
1answer
260 views

Interactively Display Values of a Heatmap.js leaflet.js Heatmap Layer

In this example of the heatmap.js tool, I see how the values of the heatmap is returned by using heatmapINstance.getValueAt(): demoWrapper.onmousemove = function(ev) { var x = ev.layerX; var y =...
1
vote
1answer
95 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 ...
1
vote
1answer
70 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
1answer
53 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 ...
1
vote
1answer
205 views

Use self-defined Leaflet identifiers to work with jsTree checkboxes

I have some hierachic structured point-layers in a GeoJSON file using jsTree (ajax) with checkboxes to add them to the map. As I have about 20.000 points structured in 2.000 nodes representing the ...
0
votes
1answer
44 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
1answer
105 views

Programmatic way of accessing mapbox tileset from leaflet WITHOUT studio

I have a R shiny app that successfully uses leaflet to interact with a custom mapbox studio style. mapbox_url = "https://api.mapbox.com/styles/v1/bweinstein/ck94nmzn20an31imrz6ffplun/tiles/256/{z}...
0
votes
1answer
489 views

Getting width of road segment given its end points using Leaflet?

I want to highlight a road segment on a Leaflet Map. I have the coordinates of the end point of the road segment, so could plot it as a linestring. But the problem is how can I get the width of the ...
0
votes
1answer
73 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
42 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
50 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
1answer
36 views

Removing previous layer when new layer is select from drop-down menu?

I have a drop-down with some options in it, after selecting one option and button clicking I get the text and my shapefile from the GeoServer which is added to the map. So when I click on the first ...
0
votes
0answers
14 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
43 views

Leaflet and tiler for R - can't get the correct tiles for displaying in Leaflet (wrong reference systeme or something)

I have got an issue with tiler (https://github.com/ropensci/tiler). I am setting up a webapplication and want to convert .grd files to tiles that can be read by Leaflet. This example can be easily ...
1
vote
1answer
31 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
29 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
60 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 ...
1
vote
0answers
19 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
0answers
26 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
48 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", &...
4
votes
1answer
8k views

Leaflet highlight feature by ID

I have a map application where: I load polygons as GeoJSON objects I draw all polygons in a single layer I highlight a polygon on mouse hover What I need to do is the following: on mouse hover, I ...

1 2 3
4
5
68