Questions tagged [leaflet]

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

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

Overlay with the feature collection properties

I have the GeoJSON: [{"type":"FeatureCollection", "features":[ {"type":"Feature","properties":{"id":27,"name":"F001"},"geometry":{"type":"LineString","coordinates":[[-100.231018,47....
0
votes
0answers
16 views

Display multiple polygons with Leaflet? [on hold]

I need to display about 200,000 polygons stored in the PostGIS database. In the back end, I'm using net core 2.2 to create APIs and Entity Framework for queries in a PostGIS. In frontend, I'm using ...
2
votes
2answers
38 views

Scaling tiles for missing zoom levels in Leaflet?

I have two sets of tiles. One for zoom level 10 and one for zoom level 14. However, I want to be able to see tiles on my map at zoom levels 9 through 15. For the nonexistent sets of tiles I want to ...
-2
votes
1answer
25 views

Are Leaflet extensions plugins compatible with TomTom web SDK? [on hold]

TomTom in their developer site says: Does this mean that Leaflet extensions and plugins are also compatible with their SDK?
0
votes
0answers
24 views

Adding line shapefile to Leaflet map in R [on hold]

I am creating a Leaflet map in R in which I would like to include two shapefiles on top of the basemap, the first being points (trailheads) and the second being lines (trail network). I have figured ...
0
votes
0answers
18 views

Searching with Leaflet search control in layers added with Layers control?

How do I notify the search control about the layers that are added to the map? This is my web viewer: Actually, i can search only one layer, cannot search in the layers added from leaflet control ...
0
votes
0answers
26 views

Custom Routes and Streets [on hold]

I have a ArcGIS set of streets that are not mapped in OpenStreetMaps and I would like to plot these streets on a Leaflet and route through them I read a lot already and see a lot of posts of ...
1
vote
1answer
32 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
19 views

Connect GeoServer WMS data to Leaflet.js

I have WMS Layer in GeoServer, I've made it following the walk through tutorial in https://www.e-education.psu.edu/geog585/node/701 I'm confused on how to connect my WMS to leaflet.js.
0
votes
0answers
22 views

Leaflet: Unable to filter GeoJSON beyond the `properties` element level

I have the following code which displays a Layer in my Leaflet map from some remote GeoJSON: // Create Layer: Airspace var featuresUTMAirspace= L.geoJson(dataGuardianUTM, { filter: FuncAirspace, ...
0
votes
1answer
44 views

Handling popups with overlapping layers in Leaflet

I have two polygon layers (polygons) that overlap. I've created a leaflet map using qgis2web. The issues is that, if I click on the overlapping area, the popup only shows information for the topmost ...
1
vote
1answer
15 views

Passing multiple arguments to callback function in Leaflet layer method bindTooltip()

I have a few GeoJSON layers on a Leaflet map that I am using the bindTooltip method on. Specifically, I am trying to use a function as the argument to bindTooltip so that I can produce some custom ...
1
vote
0answers
38 views

Visualizing street shape data for London?

I am trying to visualise some street-level data I got, but since I'm very new to GIS I don't know the correct terminology to Google. My data looks like this: Street, Incident Count Congo Road, 12 ...
0
votes
1answer
15 views

Linked popup image in GeoJSON file

Developing the issue solved in this post: Trying to pop up image in GeoJSON file? I would like to have each GeoJSON image thumbnail possible to open in larger window. I was trying to connect with ...
1
vote
0answers
24 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....
1
vote
1answer
32 views

Trying to pop up image in GeoJSON file?

I am trying to put an image inside the geoJSON file. I know, that Geojson works as string and I cannot input the image directly, however I found some stuff, like this below: http://www....
1
vote
1answer
22 views

Binding multiple Leaflet image overlays as one

I am planning to put at least ten single image overlays, spread across the country. I have got two so far: var priorycourt = 'Priory_court.PNG', imageBounds = [[52.399892, -1.531154], [52.400837, -1....
2
votes
1answer
42 views

How to write hyperlinks to local files in GeoJSON properties?

I am wondering how to make a hyperlink from GeoJSON file properties to the local drive file. I found two options here: Clickable hyperlink from GeoJSON field in feature this option refers to a whole ....
1
vote
1answer
28 views

Resizing Leaflet CircleMarkers after zoom level changes?

I am trying to find a way to have my CircleMarkers resize themselves after zooming in or out so that they scale properly with the map. So far, I have tried firing map.InvalidateSize() on the zoomend ...
0
votes
1answer
22 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
18 views

Iterating through sub-element `sections` of GeoJSON on a Leaflet map?

I have the following code which I use to display a marker on my map with a popup containing the feature.properties.name element from my GeoJSON: var featuresUTMGroundHazards = L.geoJson(...
0
votes
1answer
22 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 ...
0
votes
0answers
30 views

Leaflet control window is not a function

I trying to add a leaflet control window to my map, but i get an error in the console of browser. The error is in console is: Uncaught ReferenceError: L is not defined at L.Control.Window.js:1 ...
0
votes
0answers
27 views

Leaflet GeoJSON legend with custom icons

I have been developed a legend, details are here: Leaflet GeoJSON map legend Now I am wondering how to take into account my custom icons, set for GeoJSON file. var myIcon = L.icon({ iconUrl: '...
3
votes
1answer
48 views

Leaflet mouse move to get coordinate

I hope to be able to display the coordinates on the map when the mouse moves, not to use marker. But my code can't run successfully. This is my code: <html lang="en-US" xmlns="http://www.w3.org/...
0
votes
2answers
34 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
0answers
19 views

Display route and the two markers in Leaflet routing Machine?

How do I make the route and the two markers appear in Leaflet routing Machine? Here is my code: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> ...
1
vote
1answer
27 views

Leaflet load JSON data

Does my code have problem? Because if I run in Visual Studio, it doesn't show error, but the file didn't load on my map. I put the JSON file and HTML on my desktop. This is my code : ...
1
vote
1answer
52 views

Leaflet Foreach point in GeoJSON check Distanceto

So I was wondering how I can get the points from the GeoJSON located here. and then for each of them separately check if the distance of Markers is within 5 meters range of these. I have tried but ...
0
votes
0answers
29 views

Adding JSON layer in Leaflet just like GeoJSON data? [duplicate]

I am trying to add different layers to a leaflet map. Now i really want these layers in order to add features like zoom. With GeoJSON file this was easy but I am not getting a good way to plot array ...
1
vote
0answers
31 views

Load JSON data Problem

Why my file only read data3 popup data? data1 and data2 just popup the data3 data <html lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> <head profile="http://gmpg.org/xfn/11"> &...
0
votes
0answers
25 views

Leaflet load GeoTIFF file from browser [duplicate]

I want to load a GeoTIFF file from a browser using Leaflet. I have created a custom control button that on click loads a file from local computer. fileInput.Change() is the function that is called, ...
1
vote
1answer
30 views

Unable to use fillColor values from GeoJSON with Leaflet

I have a web page which fetches some remote GeoJSON and displays a combination of marker points, polygons and lines on my map. Within that JSON is the fillColor, fillOpacity, etc that I wish to use ...
0
votes
1answer
41 views

GeoJSON search box for multiple layers

I am wondering how to make the GeoJSON search more efficient. I would like to get the search result from more than 1 layer in GeoJSON. My code is (I attached one of two GeoJSON examples): var test = ...
0
votes
1answer
33 views

Search box for GeoJSON in Leaflet

I have been struggling with adding a search box for GeoJSON stuff, similar to COntrol.geocoder in Leaflet. I used the advice under this post: Adding one search box for multiple GeoJSON polygon layers?...
1
vote
1answer
54 views

Load polygon JSON to Leaflet

I want my JSON data with URL can load on the map, and it is a polygon data. I don't know what the problem with my code. This is my code: <html lang="en-US" xmlns="http://www.w3.org/1999/xhtml">...
3
votes
1answer
42 views

Zoom marker text when zooming map

I am trying to have multiple labels on a non-geographic map (image), but when I zoom in and out, I would like the text to grow and shrink in size corresponding to the zooming. Here is what I have: ...
1
vote
0answers
29 views

Adding WMS legend to see or remove layers in relation to the layer control? [closed]

This is the code, the problem is that always print the same png legend even if you select another layer. function addLeyenda(layer){ if( layer instanceof L.TileLayer.WMS ){ ...
0
votes
1answer
36 views

Leaflet marker popup link from outside of map dynamically

I am using Leaflet JavaScript library to show some earthquake informations. You can able to see few red circles on map. When you click that red circle it will display few details in popup. I want to ...
1
vote
1answer
25 views

Polyline is not pointing to correct langitude.latitude data in Leaflet [duplicate]

I am trying to add polyline in my existing leaflet map. But unfortunately its not overlapping the correct coordinates. this.testd = [ [26.946345158021394, 45.30658810117468], [31....
0
votes
1answer
45 views

Loading GeoJSON file into map in Leaflet

I put my GeoJSON file on my desktop, I don't know why my file can't load to the map. My code: <html lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> <head profile="http://gmpg.org/xfn/...
0
votes
2answers
31 views

Leaflet GeoJSON popup marker customization

I would like to customize leaflet .bindPoPup geoJSON marker. I found some solutions, although I would like to use my existing one. Basically the operation leads to merge two functions as per below: ...
0
votes
1answer
41 views

Web Application using Leaflet

I'm trying to make a web application mainly with Leaflet. This is my code. I can download a file, but when you first open this web application, no layers are shown on the map. However, once I loaded ...
1
vote
2answers
33 views

Leaflet GEOJson marker pins are not a Layer?

I currently have the following code which is used to display a series of GEOJson marker pins on a LeafletJS 1.5.1 map and it also displays a KML layer which can be toggled on and off using a checkbox. ...
2
votes
2answers
64 views

Open popup with click on tooltip in Leaflet

I'm trying to open a popup when clicking on a tooltip of a layer. I try following code: function add_layer_rescue_spot() { rescue_spot_layer = new L.GeoJSON.AJAX(rescue_spot_path, { ...
1
vote
1answer
53 views

Cutting holes in custom polygon made with Leaflet.Draw

I would like to be able to create holes in polygons made with Leaflet.Draw plugin. For example, I currently have code like this: https://jsfiddle.net/4gkrfu5b/ If you draw a polygon on top of another ...
0
votes
1answer
30 views

Get L.marker individual attributes

I am using this code to draw points on the map: coordsArray.push(lat); coordsArray.push(lng); marker = L.marker(coordsArray, { icon: myIcon, clickable: true, draggable: 'false', title:...
1
vote
1answer
33 views

Highlighting GeoJSON components based on common feature properties

I have a GeoJSON map. It's a map of a country, which is made up of states, which are in turn made up of sub-state regions. I can create a Leaflet map where I can highlight (in this case 'orange') the ...
1
vote
0answers
46 views

Search for bookmarks with realtime-leaflet

I'm using Leaflet with realtime-leaflet to show real-time bookmarks, but I need to add the search control on the bookmarks that are real time, I'm using an AJAX request and I doubled the bookmarks on ...
0
votes
0answers
28 views

Adding load file feature into web application with Leaflet

I'm creating a web application with Leaflet and add file load feature like the image below. However, it didn't work and didn't show the icon either. <!DOCTYPE html> <html lang="en"&...