Questions tagged [leaflet]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
81 views

Google Maps satellite view footprints not congruent to street map view

I am trying to draw the layout of a building and project them to a web map using Django and Leaflet. I am using a satellite image to get the correct latitude and longitude and then I send the ...
1
vote
0answers
97 views

Spatial operations with JSTS

I'm working with Leaflet and I'm also working with JSTS to do the spatial operations. In most of the cases I want to create Polygons inside another Polygon Geometry. In this case the yellow shape is ...
1
vote
1answer
58 views

Adding labels after meeting a zoom threshold in Leaflet

I'm making a map in Leaflet and I have up to two labels per marker: var redIcon = new L.Icon({ iconUrl: 'https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-red....
0
votes
0answers
37 views

SVG tile interactivity with vue leaflet

I am not being able to extract or interact with the svg tiles data on mouse hover/click using leaflet. I have a tile server that serves svg tiles eg:https://sometileserver.com/roads/{z}/{x}/{y}.svg, ...
0
votes
1answer
105 views

GeoJSON map color does not change

I am trying to code save/load function. I can say my save and load function works properly because it displays on console that for example when I load "Canada" file from database, it shows ...
0
votes
1answer
58 views

Adjust pop up container in Leaflet

I have a problem wit my current project. When I export my QGIS Project via qgis2web there is a strange behaviour of the map pop ups which are not fitting the content. It sometimes cuts the container ...
1
vote
0answers
121 views

Plot “large” raster with leaflet in R

I have a geotiff that is around 26MB on my hard drive. I would like to use leaflet to plot it within a shiny application. However, it just doesn't load. When I use mapview just to plot it locally it ...
0
votes
0answers
42 views

Problem displaying Line Pattern Fill style on Qgis2web

I need to export a categorized map of a region from qgis via qgis2web into an html page. The first test went well, but the problem is that I can't visualize this style applied to some municipalities ...
0
votes
1answer
127 views

Leaflet error 'Cannot read property' on bindPopup

I try to display a popup when clicking on a multi tracks XML track. This seems to work fine but JS console gives error: Uncaught TypeError: Cannot read property 'call' of undefined at e.fire (...
1
vote
0answers
112 views

Finding closest marker to user location Leaflet KNN

I am using Leaflet KNN and would like the closest station to a users location, from the web browser, to have a pop up saying it is their closest station. How can I find the nearest marker to the user ...
1
vote
1answer
22 views

Customising a marker after performing a spatial search query

I'm have a geodjango app that uses leaflet for a front-end. I have integrated the search function on the front-end to be able to search a customer location in real-time, of which the code below does ...
3
votes
1answer
253 views

.on(“load”) event for layer groups in Leaflet

I have used Leaflet's ImageOverlay to load various image layers onto a Leaflet map div (L.map). The size of the layer files can vary greatly. So some layers load very quickly while others can take a ...
1
vote
0answers
210 views

How to calculate TileRow and TileCol for GeoServer WMTS layer display in leaflet

I'm trying to display a WMTS layer coming from GeoServer 2.15.0 using leaflet 1.7.1. I've taken inspiration from L.TileLayer.WMTS to create the WMTS GetTile url: getTileUrl: function (coords) { ...
0
votes
0answers
26 views

I have these variables in Leaflet map .. my difficulty is in visualizing the information using a popup in the Leaflet [duplicate]

var ProvinciasWMS = L.tileLayer.wms('http://localhost:8080/geoserver/Mocambique/wms?',{ layers:'Mocambique:Provincias_Moz', version: '1.1.0', transparent:'true', format: 'image/png', ...
0
votes
1answer
89 views

Show WMS information in popup on Leaflet map?

I need to view WMS information through a popup in Leaflet map. I tried with the code below, but the popup doesn't come out with information, but automatically downloads a file. map = L.map(document....
1
vote
0answers
39 views

Query to Display Polygons not Working on Geodjango-Leaftlet Web App

I am currently working on a Geodjango-Leaflet-OpenStreetMap web app. I have around 540000 polygons of property boundaries that were drawn in ArcMap; the polygons will be imported to the web app later ...
1
vote
1answer
146 views

Display a track comment when clicking a track in Leaflet multi track layer

See this question Displaying different tracks from one GPX XML file in different colors in Leaflet If I hover a track the hand transforms into an index pointer but if I click nothing happens, see ...
0
votes
1answer
82 views

Highlighting a track when hovering over multi track layer in Leaflet

See this question Displaying different tracks from one GPX XML file in different colors in Leaflet I can display several tracks located in one XML file over an OSM map, example Flights map. Now the ...
0
votes
0answers
22 views

Markers appearing slightly off their points when Leaflet map zoomed out [duplicate]

I have noticed that the markers on my Leaflet map are displaying slightly off where they should be. However when I zoom in they go to the correct position. Is this a common error? How would I go about ...
1
vote
1answer
100 views

Parsing Geopackage (gpkg) file in JavaScript into array

I am a beginner with GIS. I have the following code that is successfully creating and displaying a map: <div id="map" style="width: 1000px; height: 700px"></div> <...
2
votes
1answer
30 views

Does the number of decimal places in coordinates affect the speed of rendering of the features on a Leaflet map?

I am trying to improve the performance of a webpage that renders hundreds of points on a Leaflet map. I noticed that the coordinates of these points are saved and retrieved with unnecessary accuracy (...
1
vote
1answer
52 views

Resetting a marker Style after another marker has been clicked

Is there a way to reset a markers colour after clicking off of it. I am trying to make the markers colour change once clicked on and then update the infobox to the name of the train station and zoom ...
0
votes
1answer
50 views

Leaflet: Error when showing marker name within an info box/popup from GeoJSON data

I am trying to make it so when you click on the marker you get a popup with the name of the station within wales. Live working of my code: https://ces-web2.southwales.ac.uk/students/18018815/mitchtut/...
1
vote
1answer
157 views

Correct way to stop Leaflet Map propagation

What is the correct use of the Leaflet stopPropagation? I have a canvas map drawn with some custom png markers. That works great, but when they are clicked, both the marker and map click events are ...
0
votes
1answer
149 views

Displaying different tracks from one GPX XML file in different colors in Leaflet

I use Leaflet to display tracks described in XML file on OpenStreetMap background. Some of my XML files contains several tracks, example Multi tracks. Is it possible to display each track with a ...
1
vote
1answer
54 views

Showing different markers on hover

I have a list of links and withing the links I have data attributes for lat and lon. <a href="#" data-lat="23.232322" data-lon="-97.2466634"> <a href="#&...
0
votes
1answer
82 views

Search & Display Function for Geodjango-Leaflet Web Map

I am trying to add a search function into my Geodjango-Leaflet-Openstreetmap web map. I have around 540000 polygons of property boundaries that were drawn in Arcmap; the polygons will be imported to ...
0
votes
1answer
172 views

Leaflet R - plotting raster with colour palette

I am trying to plot a raster image using Leaflet, however I am having issues getting the colours right. I've read in the raster like this and plot the the resulting raster variable. library(raster) ...
1
vote
1answer
56 views

Changing the colour of a GeoJSON polygon if user location is within it in Leaflet

I am wondering if there is a way to change the colour of a polygon got from a geojson file only if the users/browser location is within that polygon if so is there any example or working code that ...
0
votes
1answer
48 views

Using large data JSON file in Leaflet markercluster [closed]

I want to show the JSON file consisting of many points on the map using the leaflet marker cluster plugin. My JSON file looks like: [ { "json_featuretype" : "Output", "...
0
votes
0answers
25 views

Understanding Leaflet 'Tileerror'

I currently have a faulty WMS layer that I am pulling from Geoserver. I am trying to understand why they are faulty by using Leaflets in-built 'tileerror' hook though the info that comes back doesn't ...
1
vote
2answers
305 views

Changing leaflet circle marker colour and size when clicked upon

I am currently using GIS to plot train stations within Wales I have currently made a custom circle marker to point to that of the stations latlng successfully adding it to the map. I am wanting the ...
1
vote
1answer
110 views

Select several polygons with the same identifier in GeoJSON layer

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 from a identifier list Some polygons have the same ...
0
votes
1answer
66 views

Manipulating data with a Handsontable spreadsheet in a Leaflet GeoJSON Layer and rerender the map

The goal is to add a spreadsheet view to a GeoJSON Layer to comfty edit the properties directly in the spreadsheet and the location (lat/long) within the map by dragging the marker with leaflet.draw. ...
0
votes
0answers
29 views

Is it necessary to sanitize GeoJSON/WKT inputs to Leaflet / Terraformer?

I am currently building a website which includes the following: a Leaflet map where users can draw polygons using Leaflet-draw (and enter other data using HTML forms) a paired text field where users ...
2
votes
1answer
111 views

Updating Leaflet label from form in popup

I have a Leaflet map with markers that originate from two places: Stored coordinates in a database, retrieved as JSON and loaded to a GeoJSON object. The other is markers created from leaflet.Draw ...
1
vote
1answer
128 views

Add polygon (buffered line) created by turf.js to map in Leaflet?

I am trying to create a buffered line layer by creating GeoJSON line string from routing line and buffering it with turf.js and then show it on the map. Here is my code: route.on('routeselected', ...
0
votes
0answers
38 views

Setting a number of decimal places a GeoJSON will have when pulled from PostgreSQL db

I have noticed that the markers on my Leaflet map are displaying slightly off and I believe this is being caused by the GeoJSON coordinates only pulling to 4 decimal places. I can see this by looking ...
0
votes
0answers
35 views

Dropdown list and map.fitBounds in Leaflet

In my Lealfet application I have a dropdown list which uses data from a GeoJSON to directly populate the list. HTML <div class="form-group"> <label for="inputCS"><...
-2
votes
1answer
57 views

GeoJSON coordinates are displaying incorrectly on map

I am setting up my first Leaflet map with react / node / PostgreSQL and have managed to get to the level where I have pulled the geojson form my PostgreSQL database. However from what I can see the ...
0
votes
0answers
30 views

How do I display data from a django rest get request in a react-leaflet using onEachFeature? [duplicate]

I imported shapefiles into my PostgreSQL database with PostGIS extension and created a REST API using Django which has a GET response like this: [ { "objectid": 1, "id_field&...
1
vote
0answers
55 views

Query a region within a larger region with GeoDjango REST API

I have a working Django REST API which can query all the counties in a country. //My model class kenya_counties(models.Model): objectid = models.BigIntegerField() id_field = models.BigIntegerField(...
-1
votes
1answer
109 views

GeoJSON custom marker for different data sources

I need help how to show markers with two different colors for two different GeoJSON data sources. Here's first source geojson.php: { "type": "FeatureCollection", "...
1
vote
0answers
43 views

How to add and delete the Leaflet OpenStreetMap dynamically

I have to place the Leaflet maps to be placed in the bootstrap grids (maps has to place dynamically with the number of elements coming from the backend i.e number of elements = no of Leaflet maps). ....
1
vote
2answers
74 views

How to make a second WFS request via Ajax call from GeoServer?

After making the call for this WFS from GeoServer I'm able to display it on the map without any problem. But how do you run two (or more) requests to get another WFS? Here's my WFS request for the ...
1
vote
1answer
115 views

How can I add WFS using Leaflet Control Tree?

How do I add WFS when using the Leaflet.Control.Tree by jjimenezshaw plugin? Without using the control tree plugins, I can to make the call from Geoserver through Ajax and display my data on the map ...
2
votes
2answers
97 views

Add Geodjango MultiPolygon to Leaflet Map

I'm building a geospatial mapping application with Geodjango. I have created a model which has a MultiPolygonField(): class newJob(models.Model): job_name = models.CharField(max_length=64) ...
3
votes
1answer
72 views

Add image in popup from json Url or image folder?

Added individual url and image for 21 places in json file. Am trying to add image in my popup. Image shows up but broken in the popup. Not sure where in the code the error is?? (Same error for every ...
1
vote
2answers
92 views

Popup for each feature when using Leaflet marker.cluster plugin

I have leaflet map to display locations of points. Firstly, I use leaflet.ajax plugin to load the points data in GeoJSON format, then I want to enable cluster view using the Leaflet.markercluster ...
0
votes
2answers
76 views

Loading GeoJSON data to Leaflet overlay?

I am trying to get GeoJSON data from an API URL to an overlay. Code; // - GET GEOJSON DATA WITH AJAX TO OVERLAY REGION - // // Get the data var regions = $.ajax({ url:"https://public....

1 2
3
4 5
72