Questions tagged [leaflet]

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

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

Leaflet Turf.buffer projection

I successfully created a buffer on Leaflet with Turf.JS . I had to change the map CRS to WGS84 (epsg:4326) to make it work. But the problem is that I need to go back to the default CRS of Leaflet ...
1
vote
0answers
16 views

Does Leaflet have corresponding components that can convert the data parsed by dxf into geojson?

I plan to import cad files on the web and then use Leaflet to render an editable map. I have used dxf-parser to parse the dxf file, Is there any component of Leaflet that can convert dxf data into ...
0
votes
1answer
32 views

Info about added layer from map.on(layeradd) event in Leaflet

I added this to my leaflet.js: map.on("layeradd", function(evt) { myLocalName = "on layeradd"; console.log(myLocalName, evt); }); I have to know which layer has ...
0
votes
0answers
83 views

Custom toolbar of leaflet.draw in React

I'm trying to prepare custom buttons to draw single polygon in my react app with leaflet maps. I know how to start action of drawing but I'm not sure how to ensure editing, delete and saving ...
0
votes
0answers
38 views

Customizing Layer Display in Map based on Nested Criteria selection with dropdown field outside the Map

I have about 5 different polygon map layers on a map. Each map layer data is stored as separate JSON file (Eg: continent1.json, continent2.json, ...... continent5.json). Every layer have its own ...
0
votes
0answers
10 views

Issues implementing FlexBerry WFS-T Leaflet intersect filter

Using the FlexBerry WFS-T leaflet plugin, I am looking to add a subset of my WFS-T service using a filter. The following code works if I exclude the filter parameter. The function creates a polygon ...
0
votes
0answers
27 views

Bilinearly interpolate WMS using leaflet

I have a raster hosted on GeoServer as a WMS that has 10 km resolution and is bilinearly interpolated to look smooth around the edges as such: I am using Leaflet to make a js map with this raster ...
0
votes
0answers
8 views

Polyline don't show up when leaflet-measure starts - Django

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css"> <link rel="stylesheet" href="https://unpkg.com/...
1
vote
1answer
21 views

How to highlight multiple polygons at once based on feature properties value

I am trying to figure out how to highlight multiple polygons/features based on the feature.properties.NAME value. My polygons are a bit broken up so they are separate features and using an ...
0
votes
1answer
31 views

How to add an accordion inside a leafletjs popup marker?

I would like to include a collapsible button/accordion inside a leaflet pop-up marker. I have added a button, +css, +js, but It is always closed despite clicking it. Has anyone experienced this issue. ...
2
votes
1answer
40 views

Editing a GeoJSON layer that I just added to the map

I have created a Leaflet map and added a GeoJSON layer like this. var map_rgb = L.map("map_rgb",{center: [userLat, userLon],crs: L.CRS.EPSG3857,zoom:'{{zoom}}',zoomControl: true,preferCanvas:...
0
votes
1answer
47 views

Leaflet, add WFS modifying a working example

I like this example of the boroughs of Amsterdam: Boroughs of Amsterdam wfs in leaflet https://geodata.nationaalgeoregister.nl/wijkenbuurten2014/ows?service=WFS&version=2.0.0&request=...
1
vote
1answer
42 views

A WMTS layer (Topotijdreis) does not show in Leaflet map

I want to maka a map with the following layer/data. But the map does not show up. This is the WMTS service: here I am using programming language R and the leaflet package in R. My code looks like this:...
0
votes
1answer
57 views

Custom sized buffer , Turf.js and Leaflet Draw

I'm looking forward to buffering an object drawed with Leaflet Draw , and with a custom width in kilometers in a div. First Name: <input type="text" id="myText" value="...
1
vote
1answer
83 views

Leaflet MarkerCluster - extra marker underneath the cluster circle before it is exploded

I am programmatically adding new markers to my map with this code: const geojsonLayer = L.geoJSON(null,{ pointToLayer: function(feature, latlng) { return new L.marker(latlng) ...
1
vote
1answer
60 views

Drawing a segment of azimuth from values defined in Leaflet

Following the query: QGIS drawing segment of azimuth from values defined I would like to do something similar in Leaflet. Unfortunately, I cannot use the QGIS2Web plugin for this purpose, because I ...
0
votes
1answer
86 views

Splitting / Highlighting area in filled in turf polygon in leaflet.js based on input 1-100%

In my previous questions, how to split a polygon into rectangles of a specific length, this is the code i arrived at in the end with the help of a fellow programmer. Splitting polygon with turf....
-1
votes
1answer
49 views

Custom maps in Leaflet with MapTiler and geoJSON [closed]

In an app that I am currently developing I have downloadable "modules" that alter the look & feel of the app. As part of that experience I also need to adapt the look & feel of the ...
1
vote
1answer
141 views

Splitting polygon with turf.rectangleGrid in vue.js Leaflet map

The turf.rectangleGrid function from turf.js (https://www.npmjs.com/package/@turf/rectangle-grid) makes rectangles inside a bbox, but I want them in a polygon. The options take in a mask: Polygon not ...
0
votes
1answer
57 views

Aggregate polylines in JavaScript (Leaflet)

After executing a certain amount of routing calculations, I have a list of vehicle routes as shown in the image below. Now I have added an opacity to these lines to visualize the frequency of certain ...
3
votes
1answer
102 views

Setting unique polygon fill color after loading GeoJSON into Leaflet

New to Leaflet. I tried to set the fillColor to red. It is not working. I want each Polygon (there are less than 10 in this geoJSON) to have a unique color. Code is here: <!DOCTYPE html> <...
1
vote
1answer
77 views

Maintaining topology on MultiLineString

I'm trying to get topological movement of lines with Leaflet-Geoman plugin using TopoJSON. There is a method called topojson.mesh , which Returns the GeoJSON MultiLineString geometry object ...
1
vote
1answer
64 views

Combine tiled layers as one layer in Leaflet

How do I add multiple layers to the leaflet map. I have added the overlay_tile to the tilelayer but nothing happens. tilelayer = L.tileLayer(url_tile,overlay_tile, {noWrap.... My example can only have ...
1
vote
0answers
77 views

Sharing a single common boundary line within two polygons with Leaflet

Is it possible in Leaflet, to share a single common boundary within two polygons, other than two overlapped boundaries within a MultiPolygon layer? In this plugin (leaflet-geoman), they have mentioned ...
1
vote
1answer
451 views

How to fully customise LayerControl() in Folium?

I currently have a Folium map with this LayerControl component. Would it be possible to fully customise the layer control panel? For example, I would like it to not show the map style button saying &...
1
vote
1answer
62 views

Struggling to return GetFeatureInfo over QGIS Server and MapServer WMS layers [duplicate]

I have a HTML/Leaflet page utilising BetterWMS script (https://gist.github.com/rclark/6908938). The script returns GetFeatureInfo over WMS layers. Unfortunately it is not working with WMSs published ...
0
votes
1answer
96 views

Problem with Nearest vertex and Shortest Path function in Leaflet

I am a new Leaflet user and I have challenge to get shortest path by pgRouting, GeoServer and Leaflet as a front end application. I followed this tutorial pgRouting + GeoServer + Leaflet JS as a ...
1
vote
0answers
71 views

Using ArcGIS Online PBF from FeatureServer in Leaflet

I'm looking for a way to use the PBF format from an ArcGIS Online FeatureServer in Leaflet. There are lots of examples using L.vectorGrid.protobuf with URLs for PBF tiles structured like {z}/{x}/{y}....
2
votes
1answer
99 views

BetterWMS script doesn't work with QGIS Server and MapServer WMSs

I have a HTML/Leaflet page utilising BetterWMS script below. The script returns GetFeatureInfo over WMS layer. Unfortunately it is not working with WMSs published by Qgis Server and MapServer, ...
1
vote
1answer
41 views

Leaflet Shiny and polygons across the dateline

I have a Shiny app which maps country characteristics to their SF polygons (from rnaturalearth) using Leaflet. I'm having trouble displaying the polygons around the dateline (antemeridian) in the ...
1
vote
1answer
83 views

Custom marker for each category on Leaflet Mapbox

I am trying to place an image for each category I have but I can't get it to work. I am using GeoJSON to get the data from a Wordpress. I have tried many things but I don't know exactly where to ...
-1
votes
1answer
57 views

How do you convert WGS84 GPS coordinates to "SWEREF 99 TM" ones in JavaScript + Leaflet.js + proj4 + proj4leaflet? [closed]

I have made a map system with JavaScript + Leaflet.js + proj4 + proj4leaflet. I'm trying to link to Lantmäteriet's map with the current position, but, of course, they don't use the "WGS84" ...
1
vote
0answers
42 views

Adding attribution to GeoJSON layer

I'm using ipyleaflet and I try to add attribution to a GeoJSON layer. I was thinking that GeoJSON objects were TileLayer so I tried the following: map = ipyleaflet.Map() data = json.loads(self.gdf....
0
votes
0answers
29 views

Is it possible to create personalized functionalities with the draw control on LeafLet?

I know I can create buttons with specific functionalities on Leaflet as it says on its documentation. However, I'd like to create personalized buttons on the left side that will execute functions that ...
1
vote
1answer
41 views

Problem of marker click with Leaflet

I am new using Leaflet with R studio and I have a problem ou both Leaflet markers and map_marker click . The first problem is that , when I put addCircleMarkers in the observer in doesn't work while ...
0
votes
1answer
59 views

Drawing on Leaflet map give incorrect coordinate

I am using Leaflet and OpenLayers. When I draw a bounding box I am getting the correct lat and lon if I use OpenStreetMap tilelayer. When I switch to using EarthData tilelayer the bounding box is ...
1
vote
0answers
43 views

Remove M value & Z value from shapefile JavaScript [closed]

Is there a way to remove the m value and the z value from a shapefile using JavaScript "leafletjs & shpjs”?
1
vote
1answer
41 views

Leaflet Circle Rendering as Marker

I'm trying to create a map with circles of different size radii, to this end I'm trying to use the Leaflet circle class. The issue I'm having is that despite specifying circle and passing a radius the ...
1
vote
1answer
80 views

Leaflet Shpjs shpfile does not appear in Chrome

I'm using the package shpjs with Leaflet to import shapefiles and show them on the map. It works perfectly on Firefox Mozilla, but not for some shapefiles in Chrome. This is my code: var shpfile = ...
0
votes
1answer
96 views

Getting error when trying to display points from GeoJSON in Leaflet 0.7.7 [closed]

I tried to display the point from GeoJSON but there is an error: Uncaught Error: Invalid LatLng object: (NaN, NaN) This is my source code: maps.setView(new L.LatLng(-8.203824, 113.175476), 12); ...
1
vote
2answers
88 views

Pop up on circle markers not working with polygons in Leaflet when using clustering

I am using two GeoJSON data, one for Multi-Polygons and another for markers (Point) in the following functions: var basegeomap; function loadbasemapstate() /*polygon data*/ { basegeomap= L.geoJson(...
0
votes
0answers
129 views

Leaflet popup immediately closing

In my map (http://www.enjoytheparks.com/EtP_Map.html) I display "special" popups for Park Points of Interest. To see this, you would have to select a park first. Easiest way is use the ...
1
vote
1answer
73 views

Passing GetMap requests to GeoServer from Flask

For some reason, I try to use Flask as a proxy layer between client and server to control all requests sent to the geoserver. The thing that I want to do is to send the GetMap request to the GeoServer ...
0
votes
1answer
38 views

Leaflet & special characters

I have a problem regarding Leaflet and calvinmetcalf's shapefile module. In my shapefile I have fields and in those fields are strings like: 'Frankfurt' 'Tübingen' 'Géramer-sur-Mer' You see that due ...
1
vote
0answers
44 views

Leaflet Choropleth Map Highlight Stay

I currently have a leaflet choropleth of the contiguous 48 states that when you hover over a state a popup on the right side of the site this is done using "cards" (https://www.w3schools.com/...
0
votes
1answer
88 views

Loading GeoJSON data into Leaflet map using getJSON problem

I've a problem loading GeoJSON data into Leaflet map using getJSON. None of the GeoJSON data is displaying. The basemap & two circles are showing so it looks like Leaflet is working as expected. ...
-1
votes
1answer
57 views

Leaftletjs load XML and GeoJSON

I found below piece of code which loads GeoJSON from USGS then shows circle and set radius. This works fine when tested. (function () { var FEED1 = 'http://earthquake.usgs.gov/earthquakes/feed/...
0
votes
1answer
101 views

Rendering Google Maps tiles in Leaflet (offline)

I have Google Maps tiles on my computer in a folder. I want to use it offline in Leaflet. Actually, Leaflet use by a link to load the map like below: L.tileLayer('https://{s}.tile.openstreetmap....
-1
votes
1answer
37 views

Calculate pixel and area from PNG or Geotiff to measure area under NDVI [closed]

We have built an Application that generates NDVI Imagery using API. What we are trying to achieve is to let users have an option to understand what areas of his/her farm have good and bad NDVI.NDVI ...
1
vote
1answer
105 views

Toggle clustering on/off in qgis2web map

I downloaded the Leaflet.MarkerCluster.Freezable addon which let's users control enabling/disabling clustering described in this post. After exporting a web map using qgis2web, I followed the Quick ...

1
2
3 4 5
73