Questions tagged [leaflet-plugins]

The tag has no usage guidance.

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

Leaflet Enable Snapping L.Draw Polygon

how i can enable Snapping on L.Draw Control Polygon in latest versions of Leaflet 1.8, without using geoman I am using L.Draw.Polygon to enable drawing on the map, here is code for that ...
1 vote
1 answer
73 views

Checking whether a polygon drawn with Leaflet-Geoman plugin is valid?

We are using Leaflet.js to allow our users to draw polygons and save them to their GIS server. We do this by converting the geometry from Leaflet into WFS format and making an Insert Transaction via ...
  • 157
1 vote
1 answer
28 views

Sort items of Leaflet List Markers plugin control?

I'm reading shapefiles with the leaflet library. I print the list of markers on the left in a list via the Leaflet List Markers library. I should sort the list of map markers that are shown to me on ...
0 votes
0 answers
54 views

Leaflet JS: How to check if a Lat/Longitude is in proximity going away from the original point?

I am trying to generate a route where each point in the route has progressively a lower elevation than the last point. So a route would look like this: [A, B, C, D, E] So E, would be lower than D ...
1 vote
1 answer
257 views

Check if a point is inside a GeoJSON polygon in Leaflet

I am trying to determine if a point is inside a GeoJSON polygon or not, using the Leaflet.PointInPolygon plugin. See example code below: <script src="https://cdn.rawgit.com/hayeswise/Leaflet....
  • 475
0 votes
1 answer
64 views

Get current and average speed - Leaflet

The following code would allow for tracking and giving the speed of a user. I'd like to have this info, and even average speed, but I receive this error: "166:37 Uncaught TypeError: ...
0 votes
1 answer
58 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 ...
  • 11
0 votes
0 answers
45 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....
  • 35
1 vote
1 answer
55 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. ...
  • 73
1 vote
2 answers
145 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....
  • 221
1 vote
1 answer
87 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....
  • 221
1 vote
1 answer
50 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, ...
  • 221
1 vote
1 answer
132 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....
  • 307
1 vote
2 answers
150 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,...
  • 221
0 votes
0 answers
25 views

How to get pixel values upon clicking on a webmap published using qgis2web?

So I want to publish a web map using the qgis2web plugin on QGIS. My web map has 2 raster layers with the same footprint, one on top of the other. Now, I want that upon clicking any pixel on the top ...
1 vote
1 answer
123 views

TypeError in showResult for leaflet-geosearch

I'm using leaflet-geosearch. When I click on an address from the search bar, I get the error: Uncaught (in promise) TypeError: Cannot convert undefined or null to object at Function.keys () at ...
0 votes
1 answer
63 views

Leaflet Ruler check if the ruler is in use

I don't have much experience with Leaflet and I'm using the ruler from here. I'm trying to find out if it's in use when the map zoom changes. var rulerOptions = { position: 'topright', ...
  • 221
0 votes
1 answer
71 views

Using Leaflet.motion plugin on geometry returned by WFS service?

I'm back with my Leaflet.motion service because I'd like to link it to an existing WFS service for easier and live updating. The Javascript plugin for WFS and Leaflet motion are: <script src=&...
0 votes
2 answers
290 views

Using GeoJSON as input to leaflet.motion plugin in Leaflet

I'm interested by the script Leaflet motion. I tried to update the code to add a custom GeoJSON created from QGIS or any tool. But the current error is : leaflet.motion.min.js:9 Uncaught TypeError: ...
0 votes
0 answers
122 views

Display features OSM buildings

Using Leaflet, I've installed OSMBuildings, yet I'm unable to display buildings features although it's allowed on https://osmbuildings.org/ It seems like there is a latitude and longitude once we ...
  • 1
1 vote
1 answer
419 views

FeatureGroup polygon and polyline cannot be edited with Leaflet-draw

I don't have much experience in Leaflet and I'm trying to learn from my mistakes. I have multiple polygons (just polygons) and some that have a polyline on top of it grouped as a featureGroup like: ...
  • 221
1 vote
1 answer
243 views

Leaflet - add circle around mouse icon on draw

I'm a beginner in Leaflet and I have the draw control added for polygon drawing: var drawControl = new L.Control.Draw({ draw: { marker: false, polyline: false, rectangle: false, circle:...
  • 221
2 votes
0 answers
112 views

Drawing buffer zones in React-Leaflet

I am working with a Leaflet in react.js and using react-leaflet-draw. I can't draw a buffer on shapes drawn by react-leaflet-draw. Just like a “leaflet-buffer”.
  • 21
1 vote
1 answer
138 views

Display a Leaflet Heatmap with a gpx file and Omnivore

I first displayed a Leaflet Heatmap with the plugin : "leaflet-heat.js" and a geojson file with this code found on Gis.Stackexchange var geoJsonUrl = "link to the geojson file" ...
  • 175
1 vote
0 answers
720 views

Leaflet and MBtiles rendering using Leaflet.TileLayer.MBTiles

I would like to render a map with Leaflet from a MBTiles file using the Leaflet.TileLayer.MBTiles library. I added the MBTiles file on the same folder with index.php. I am NOT using a web server like ...
  • 111
1 vote
1 answer
128 views

Move Leaflet.TimeDimension plugin slider with keyboard?

I added a time dimension slider to a leaflet map to display a series of points in a range of time. This is the code: var mymap = L.map('mapid', { zoom: 3, center: [50.4, 10.7], ...
  • 247
0 votes
2 answers
407 views

Get info for all features upon click with betterWms Leaflet plugin?

var layer = L.tileLayer.betterWms("http://localhost:8080/geoserver/wms", { layers: 'data', format: 'image/png', transparent: true, }).addTo(map); When adding this GROUP WMS ...
1 vote
0 answers
274 views

Implementing Leaflet plugin "Leaflet.Control.Layers.Tree" in R leaflet

I want to use "Leaflet.Control.Layers.Tree" in my R script. I am using the leaflet R-package to draw my map. I found this great leaflet plugin: "Leaflet.Control.Layers.Tree". How ...
1 vote
1 answer
330 views

Using L.Control.Opacity plugin with GeoJSON layer in Leaflet

I have a fully working map with a few base layers and some buttons, each of which loads and displays different resources. One loads some historical map overlays and uses the L.Control.Opacity plugin ...
0 votes
1 answer
117 views

Hide Wikipedia plugin layer below certain zoom level in Leaflet

How can I turn the following code into a variable, so that I can choose, or not, to load it in the layer control? and not anymore on moving the map or reaching this zoom level. I added a var wikilayer ...
2 votes
1 answer
864 views

Unable to remove marker cluster group completely from the map in Leaflet

I am having a weird issue with removing a MarkerClusterGroup layer from the map. When at a zoom level more than 5, I want to show markers on the map in a MarkerClusterGroup layer. When zoomed to less ...
  • 223
1 vote
1 answer
792 views

Getting coordinates after address has been picked in Leaflet geosearch control?

I'm using leaflet to make a web map with an address search bar. For that I'm using leaflet-geosearch plugin I need to retrieve the result once the user has picked the correct address from the search ...
1 vote
1 answer
121 views

Leaflet Flickr photos and Marker cluster small image broken relation

I intend to use Jose Mamira's Flickr plugin to show clustered photos from Flickr, with their thumbnail (first all photos, for this exemple, then I would easily change the code to display only my own ...
0 votes
1 answer
168 views

Zoomfit to the selected polygon of WMS Layer using Leaflet Js

I have problem in zoom fitting the selected polygon of WMS Layer. For example, I have a World shapefile. I make a dropdown menu for country names, I did when I choose a country from dropdown menu only ...
0 votes
1 answer
258 views

Use Leaflet.MultiOptionsPolyline and leaflet.motion plugins together for the same polyline

I already search through the web but no clue on how to use Leaflet.MultiOptionsPolyline and leaflet.motion plugins together for same polyline. There are two functions, one is: L.motion.polyline([[50,0]...
1 vote
0 answers
221 views

refilter method on geoJSON created with leaflet-ajax throws error, filtering works on load, no jQuery

I am building a map with a few hundred markers from a separate geoJSON file. Some of these are in the same spot, so I am using leaflet-markercluster to display them nicely. Each marker has two ...
2 votes
1 answer
2k views

Show shapefile data by Leaflet

I am trying to load a shapefile in Leaflet but no luck, It just loads the map. not sure what I am missing. Here is the file: http://data-atgis.opendata.arcgis.com/datasets/...
1 vote
1 answer
295 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) ...
  • 113
1 vote
0 answers
57 views

Local GeoJSON in Leaflet using leaflet-ajax [duplicate]

My aim is to include a local geojson file in my Leaflet map application using leaflet-ajax , as suggested by this earlier answer. In my root directory, I have: index.html entire contents of Leaflet ...
0 votes
0 answers
706 views

React leaflet map print

I want to print a leaflet map in PDF/Image formats and It will be contained, WMS layers Polygon, Markers, Polylines etc I'm using a leaflet map with React Typescript. Related versions are, react-...
1 vote
0 answers
26 views

Intersection using turf js [duplicate]

I am giving this for intersection of a polyline using Leaflet draw plugin with polygons feature class. Here is my code function intersectPolyByPolyFC(poly,fcPoly){ var fgp=[];//variable for ...
1 vote
0 answers
333 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 ...
  • 101
0 votes
1 answer
159 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", "...
  • 63
1 vote
0 answers
251 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). ....
  • 11
1 vote
1 answer
937 views

Open marker popup show when chosen from list in Leaflet

When I choose a spot from list it zooms in to it but it doesn't open/popup with label/text. Any one knows? suggestions?? This is my code; // - SEARCH ENGINE - // var clusterSpots = L....
0 votes
1 answer
353 views

How to add and remove the pop-up text based on the condition by using Leaflet

I want to show and hide the popup text based on the condition given below. .component.ts var insidecirclespace1 = (lat, long) => { for (var i = 0; i < this.sensors.length; i++) { ...
  • 1
0 votes
0 answers
1k views

Cannot access GeoJSON layer in react-leaflet

I am using React Leaflet to render Leaflet map and its GeoJSON component to render polygons. I am trying to implement dragging multiple polygons. I added Leaflet.Path.Drag library and tried to reuse ...
  • 73
1 vote
0 answers
1k views

Creating the Leaflet map offline(load the leaflet tiles without internet)

I have created the Leaflet map which works in online. But now my requirement is to create the Leaflet open street map in offline. How do I load the Leaflet map offline?
  • 11
3 votes
1 answer
1k views

Picking up the coordinates inside this polygon draw

I already have a geojson being consulted and that is plotting these black dots. And then I inserted the leaflet-geoman plugin to give users the freedom to create polygons on the map. Basically draw ...
1 vote
1 answer
735 views

Leaflet control window - how to get image & text to appear together in the content of the modal window?

I have implemented leaflet-control-window plugin into my map and it works. Modal opens on marker click and shows text. I need image to go below the text in the window but can't get it to work. When I ...
  • 13