Questions tagged [leaflet]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
16 views

Viewing tiles created from GeoJSON in Leaflet/Mapbox

I have some zxy tiles built with tippecanoe that I can load into QGIS by setting a remote connection in the Vector Tiles tab to the url where the files are kept. However, I can not load them into my ...
user avatar
0 votes
0 answers
23 views

Changing GeoJSON polygon style with mouseover on a marker in Leaflet?

I want to change GeoJSON polygon style with mouseover on a marker in Leaflet. Everything is OK, but when I hover nothing happen. Here is the code I end up with: var bandas = L.marker([6.71, 21.25], {...
user avatar
0 votes
1 answer
24 views

Leaflet GeoJSON Filter based on properties / attribute value

I'm trying to add a filter to my GeoJSON data. But I can't figure out where I should add this in my code. Pins are added to shipLayergroup. I want to filter by property KODE. (e.g. KODE = 1) var ...
user avatar
  • 561
1 vote
1 answer
57 views

Showing popup with info about all markers in the clustered marker in Leaflet?

I'm using Leaflet PlugIn markercluster for leaflet https://github.com/Leaflet/Leaflet.markercluster to visualize Points. My goal is to stop the process of "getting closer" to the points, so ...
user avatar
  • 41
0 votes
1 answer
34 views

Leaflet: fetch GeoJSON data while using markercluster plugin

I am trying to make a Leaflet map with the markercluster plugin and to fetch data from its related json file. The goal is to display various properties of my points elsewhere on the page when clicking ...
user avatar
  • 11
1 vote
1 answer
34 views

Leaflet toggle marker clustering with overlay

I am using the Leaflet markercluster plug in, and now want to add a button to turn the clustering on/off. For that I wanted to use the leaflet button plug in, because I am already using it in my code. ...
user avatar
  • 73
0 votes
1 answer
42 views

Leaflet toggle marker clustering

I am using the Leaflet markercluster plug in, and now want to add a button to turn the clustering on/off. For that I wanted to use the leaflet button plug in, because I am already using it in my code. ...
user avatar
  • 73
0 votes
0 answers
31 views

Blank map while using react leaflet and pg_tileserv [closed]

I just imported some data in PostGIS and I am using pg_tileserv to query the layers and display the data with react leaflet. I want to display the data contained in the table planet_osm_roads. Here is ...
user avatar
  • 101
0 votes
0 answers
36 views

Access Map Data generated by Maperative with Leaflet or OpenLayers

I am still quite new to mapping, and am trying to implement an offline-solution with either leaflet or OpenLayers (I managed to implement an online example which works). I am trying this using vue. ...
user avatar
1 vote
0 answers
46 views

Getting list of all points with their properties within polygon using Leaflet

I'm creating a web map application using PostgreSQL, GeoServer and Leaflet. For now I can publish data, and also ask for some simple information when clicking on a feature in the map. What I want to ...
user avatar
  • 41
0 votes
0 answers
33 views

Change map projection in Leaflet

I'm using leaflet in my current project. As a map sourse Leaflet consumes json-file with coordinates in WGS84 EPSG 4326. <l-map ref="myMap" :zoom="zoom" :...
user avatar
  • 1
0 votes
0 answers
42 views

Leaflet leaflet.groupedlayercontrol plugin does not show layers

I´m using [leaflet-groupedlayercontrol][1] plugin but failing to see layers in map. I manage to add layers to map with normal var lc = L.control.layers(baseLayers).addTo(map); lc.addTo(map); lc....
user avatar
  • 35
1 vote
1 answer
21 views

Leaflet GeoCSV popups are not being displayed

I am using the Leaflet GeoCSV plug in to try and add markers with popups to my map. With the help of this post, I have been able to add the markers to the map, but I still want to add a popup to the ...
user avatar
  • 73
1 vote
0 answers
32 views

Creating table with latitude and longitude with LeafLet, ASP.NET and SQLite?

I am trying to get the latitude and longitude and create a table from it, and show in a map, using Leaflet, however I didn't find anything that could help me in my project, the files that I have made ...
user avatar
1 vote
1 answer
97 views

Loading of local CSV file blocked by CORS policy in Leaflet

I am using the the Leaflet Geocsv plug in to display markers with popups from a csv file. When trying to aacess the file my Chrome Browser puts out this error message: Access to XMLHttpRequest at '...
user avatar
  • 73
1 vote
1 answer
43 views

Setting layers from GeoJSON property

I have a .js file with 19000 entries from where I want to create layers from a feature.properties.Issue. I have tried diferent approaches I have found in here but for some reason the layers are not ...
user avatar
  • 35
0 votes
1 answer
34 views

Leaflet GeoCSV Marker not visible on map

I am trying to load data for a Marker from a csv file and I am using the GeoCSV plugin for that. I downloaded the js file and added it to my code and also created a csv file in Excel which looks like ...
user avatar
  • 73
0 votes
0 answers
41 views

Blank tiles near borders of shapefile

I've generated a tileindex (.shp file) of some COG files using gdaltindex. However, when loading the shapefile through MapServer in Leaflet, some of the tiles seem to go blank partially when zooming ...
user avatar
1 vote
1 answer
25 views

CRS.Simple coordinates from SVG for GeoJSON in Leaflet

I am working with CRS.Simple in Leafleat. The y-coordinates from the SVG don't match what I'm supposed to use in GeoJson. I do not want to calculate them manually. How to use coordinates from SVG so ...
user avatar
0 votes
0 answers
31 views

Leaflet popup for SVG polygons

I am using a map with CRS.Simple. In order to draw polygons, I chose the SVG option. I know it's not the best way. And most likely it is not true. But please tell me how to bind SVG - popup Leaflet to ...
user avatar
2 votes
1 answer
42 views

Styling Leaflet markers according to property in GeoJSON file

I´m trying to place markers on a map according to some properties on the GeoJSON file, but for some reason it doesn't work. I have a JSON file which have a property named Issue and that´s what I want ...
user avatar
  • 35
0 votes
0 answers
65 views

Leaflet Routing Machine: How do you implement L.Routing.OSRMv1.extend for custom routes?

I'd like to change the Latitude and Longitude which make up a route. For example I have point A and point B the routing machine will create the coordinates and generate the details for the itinerary ...
user avatar
1 vote
1 answer
48 views

Show/hide layer by clicking on HTML link in Leaflet?

I have 7 GPX files that I successfully loaded into a Leaflet map. My problem is that I would like to show/hide each of them using some link on the web page. Let say that links have the following code: ...
user avatar
1 vote
1 answer
35 views

Change border color of individual overlay items in Leaflet-panel layers plugin?

I am using the Leaflet panel layers plug in and want to change the color of the border of each item in the overlay. I can change all of them at once in the css file but cant change them individually. ...
user avatar
  • 73
0 votes
0 answers
75 views

How to get all Zip Codes in a Route?

I have an application that shows the route from one destination to another. And I implemented it using Leaflet Routing Machine with OSRM routing engine. Following is a google map image showing some ...
user avatar
1 vote
1 answer
40 views

Generate bounding box from PNG image and World File

From this folder I can get two files: PNG Image World File   (.wld) From this page where they document how these files are to be used, they say that they are generated in the EPSG:4326 projection. My ...
user avatar
1 vote
2 answers
86 views

Editable polygon with different sized two part border (inner and outer, in meters) in Leaflet?

I'm a beginner in Leaflet JS and I have a polygon drawn on the map: var coords= [ [27.40839959582344,-82.40601726602196], [27.40859871554781,-82.40638191331237], [27.40834938302612,-82....
user avatar
  • 221
1 vote
1 answer
65 views

Leaflet Turf JS - polygon with negative offset missing some parts

I'm new in Turf JS and I have a polygon with a negative offset like: const coords= [ [25.085416706126708,55.1561039686203], [25.085351117322578,55.15612542629241], [25.08549687017286,55....
user avatar
  • 221
0 votes
0 answers
45 views

Leaflet onRemove Control

I made the code according to this page https://leafletjs.com/examples/choropleth/ and everything worked. when i open the layer everything works normally, but when i turn off the layer the legend and ...
user avatar
1 vote
1 answer
57 views

Mapbox GL JS Equivalent to Leaflet LayerGroup?

Does anybody know of an equivalent to the Leaflet L.layerGroup in Mapbox GL JS? I can do this in leaflet: var layerGroup = L.layerGroup().addTo(map); And then if I want to add, say, a marker to the ...
user avatar
2 votes
1 answer
35 views

Load WMS service into Mapbox map

I am able to add a WMS layer to a Leaflet map with very simple, readable code: var wmsURL = 'https://opengeo.ncep.noaa.gov/geoserver/klwx/klwx_bref_raw/ows?'; var wdgProductLayer = L.tileLayer.wms(...
user avatar
1 vote
1 answer
52 views

Update marker color or size when is clicked

I'm trying to highlight the current marker. Updating the size or color of the marker when is clicked. Example: https://jsfiddle.net/jodarove/e0mwk4qp This example has an array of positions (lat, long) ...
user avatar
0 votes
0 answers
51 views

Protect my GeoJSON in Leaflet

My GeoJSON map is published by Leaflet, how can prevent download from user who want to steal it? I'd taken long time to prepare GeoJSON and I want to preserve my effort. Any suggestion? Do I need to ...
user avatar
1 vote
1 answer
41 views

Leaflet Javascript: zoom to layer only on load

I have a WFS layer, updated in a loop, and I want the view to be centered on it only the first time the map is loaded; next, when the user moves the map or waits 20 secs, there is a movend function ...
user avatar
0 votes
1 answer
32 views

How to control picture size in qgis2web?

I have created a map and imported geolocated pictures. I have no issues with the map in QGIS it self all works great the pop-ups work great. My issue is when I export the map with qgis2web I get the ...
user avatar
  • 63
1 vote
1 answer
47 views

Leaflet.PolylineOffset Polyline drawing issue

I don't have much experience with Leaflet JS and I'm using Leaflet.PolylineOffset in order to draw a polyline around a polygon: L.polygon(coords, { fillColor: 'white', fillOpacity: 0.5, weight: 20, ...
user avatar
  • 221
1 vote
1 answer
78 views

Create custom legend control using L.ExtraMarkers.icon icons in Leaflet?

Is there any way I can add Leaflet Extramarkers to my legend? From what I googled, it seems I'll have to add an image of markers... however I was hoping I could use the ones I created. var Icon = L....
user avatar
  • 310
1 vote
2 answers
78 views

Leaflet.PolylineOffset Polyline with offset is drawn on the inside of a polygon

I'm new in Leaflet JS and I'm using Leaflet.PolylineOffset in order to draw a polyline around my polygon: L.polygon(coords, { fillColor: 'red', fillOpacity: 0.5, weight: 20, color: 'red', opacity: 0.5,...
user avatar
  • 221
2 votes
1 answer
40 views

Search for multiple attributes for single layer with Leaflet Search Control?

Edit: I am working on a project where I want to search through a GeoJSON, based on different attributes. To do this I am using leaflet-search plugin. I want to search through my single GeoJSON. That ...
user avatar
  • 310
1 vote
1 answer
49 views

Displaying French TopoJSON data in Leaflet

I am trying to display a TopoJSON file i took here : https://www.data.gouv.fr/en/datasets/contours-des-communes-de-france-simplifie-avec-regions-et-departement-doutre-mer-rapproches/#resources In ...
user avatar
  • 113
2 votes
1 answer
68 views

Multiple WFS layers in Leaflet, loaded with Ajax with bounding box, do not display correctly

The following example is a code for three WFS layers on Leaflet, loading only inside a Bounding box in order to save resources. Layers can be turned on in the Layer Control as featurelayer1, ...
user avatar
0 votes
0 answers
39 views

Leaflet stops loading tiles

I create a map such as L.TileLayer.CustomUrlLayer = L.TileLayer.extend({ getTileUrl: function(coords) { console.log("COORDINATES", coords); if (coords.x &...
user avatar
0 votes
0 answers
76 views

React Leaflet layer without attribution properties

how to get layer attributes with geojson? I try to get attributes from leaflet layer, but layer does not currently contain data in e.target when i try click to Polygon. import React , { useState, ...
user avatar
0 votes
0 answers
43 views

Leaflet get map coordinates to outside of map click event function

Is there any way to get coordinates values outside of the map click event function? var x_array = []; map.on('click', function (e) { let latlng = map.mouseEventToLatLng(e.originalEvent); var x = ...
user avatar
1 vote
1 answer
66 views

Leaflet js add polygon with offset around another polygon

I am pretty new in working with Leaflet js and I have a polygon var coords = layer.getLatLngs(); L.polygon(coords, { fillColor: 'red', fillOpacity: 0.5, weight: 20, color: 'red', opacity: 0.5, fill: ...
user avatar
  • 221
1 vote
0 answers
34 views

Isolated marker won't be displayed when filters are applied to be the single one amongst nearby clusters

I have markers all around the world, thousands of them. In some areas more close to each others, in other areas some even have a number of countries between them. Let's take the SINGLE marker in ...
user avatar
  • 11
2 votes
2 answers
63 views

Saving "on mouse click" created markers to be available after reloading the browser in Leaflet?

I have found that when I manually add a marker, the marker stays on the map even after reloading the browser page. Example: var marker = L.marker([51.5, -0.09]).addTo(map); However, all of my markers ...
user avatar
  • 21
1 vote
2 answers
60 views

Leaflet WFST style the markers

I am working on the point data. I have managed to display the data using the WFST leaflet plugin. var univ = new L.WFS({ url: 'http://localhost:8080/geoserver/HEC/wfs', typeNS: 'HEC', ...
user avatar
  • 310
1 vote
0 answers
82 views

Leaflet unit-testing - layer removal (jest)

I want to test if FeatureLayer is removed from the map instance, but somehow instead of expect(removeCallCount).toBe(1) I have 0. What can be the problem? test("FeatureLayer removes itself from ...
user avatar
1 vote
1 answer
43 views

Query GeoServer WFS layer attributes with form

How can I set up a form in HTML to query the attributes in my GeoServer WFS layer? I assume it has something to do with the action attribute but I'm not sure how it will work. Something like <form ...
user avatar
  • 11

1
2 3 4 5
78