Questions tagged [leaflet]

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

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

Calculate volume of a polygon using leaflet

I have a polygon and a Digital terrain model, I need to find a way to calculate the 3d volume of the area inside the polygon on leaflet. Is it possible to achieve it using some sort of formula or do I ...
2
votes
1answer
17 views

Summarize Leaflet controlLayers

I cobbled together a code where I can print the features as a popup and wanted to make the objects on and off var baseMaps = { "Wikimedia-Map": Wikimedia, "GrayCanvas-Map": Esri_WorldGrayCanvas, ...
1
vote
2answers
45 views

Why the icon can't display with my JSON data on Leaflet

I tried many time, but the icon didn't show on the map. I want to know what the problem on my code. This is my code: <!DOCTYPE html> <html lang="en-US" xmlns="http://www.w3.org/1999/xhtml"&...
0
votes
0answers
48 views

Loading URL to Leaflet [closed]

<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.4/dist/leaflet.css" integrity="sha512-puBpdR0798OZvTTbP4A8Ix/l+A4dHDD0DGqYW6RQ+9jxkRFclaxxQb/SJAWZfWAkuyeQUytO7+7N4QKrDh+drA==" ...
2
votes
2answers
53 views

Leaflet Basemap: Changing sources of basemap options in runtime?

I'm using Leaflet v 1.4.0. In LL, using L.control.layer, the basemap (and overlay) is assigned as follows: $.fn.initBaseMaps = function (selectedIndexProjectionOption) { lyrNASAGIBSBlueMarble = L....
-1
votes
0answers
29 views

Mapping large shapefiles with R? [closed]

I have a large shapefile (134MB), which I am working on in R. I want to generate an interactive map of this, something along the lines of tmap or leaflet. The trouble is, every tool I have tried ...
2
votes
1answer
66 views

Import more than one GeoJSON into Leaflet map?

I've searched far and wide and tried a number of different options but I cannot get more than one GeoJSON into my Leaflet web app. I can get one, and once I try anything else, the map itself will go ...
0
votes
0answers
22 views

Cannot read property 'decode' of undefined in lrm-google

I am following this doc Lrm-google to use google direction api with leaflet routing machine. I haven't changed much of my code except replacing geocoder: L.Control.Geocoder.nominatim(), with router: L....
1
vote
1answer
42 views

Choosing correct zoom level to display given area in square km using Leaflet?

I would like to set the zoom on a Leaflet map based on an area (in km^2). I am looking for a simple function that would approximately convert an area of 510,064,472 km to zoom level 0 and (if I read ...
1
vote
1answer
26 views

L.esri.Cluster.featureLayer does not call style function

Using the L.esri.Cluster.featureLayer plugin for Leaflet to cluster features from Esri does not call the style method despite the documentation stating that this is the way to style vector layers. ...
1
vote
1answer
52 views

With leaflet-routing-machine, how to bring a route on top?

On a simple Leaflet map, with leafleat-routing-machine, if two routes pass by the same place, only the top one is visible. I can live with this if I can choose which route is on top, (for example by ...
1
vote
1answer
42 views

Overlaying satellite image tileLayer over OpenStreetMap in LeafletJS?

I am currently creating a web app for visualizing disaster impact via satellite imagery. I have satellite images (.tif) which I need to overlay over OpenStreetMap. Since .tif file is very large, I ...
1
vote
1answer
24 views

Change Ordering of features within one layer in leaflet

My Question is exactly the same as mentioned in this Question The main difference is that I can't use bringToFront() because I have points inside the highlighted polygon that I want to show a tooltip ...
1
vote
1answer
26 views

Prevent leaflet from zooming after adding a route

The leaflet routing machine hello world adds a route on the map and automatically zooms to fit the route. var map = L.map('map'); L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { ...
1
vote
0answers
33 views

Filtering clustered markers on Leaflet.js using slider from nouislider?

I have clustered markers on the map and I am using a library called nouislider for my slider. I am using this to show certain markers based on the range of the distance specified. I got this working ...
0
votes
0answers
14 views

Leaflet Map Exported Using Export Web Map Task Looks Stretched

I'm running an Angular application that displays a map using Leaflet, and has a custom print where the user can set some options before sending a request to the ArcGIS Online print service (https://...
0
votes
1answer
35 views

How to place all unique values into a lookup array in JavaScript for a Leaflet map?

I've been working through a problem with others on 1) grabbing id's from a GeoJSON, 2) placing those id's into a dropdown menu on a Leaflet map, 3) and enabling functionality to allow the user to ...
0
votes
1answer
41 views

Understanding why LatLng returned from L.GeometryUtil.closest() are not from array being checked over?

I am using this function below from this library Leaflet.GeometryUtil to help find the closest distance between two points. L.GeometryUtil,closest(map, array, latlng) It is returning this ...
1
vote
0answers
42 views

Leaflet.js: find the shortest distance between two points (user location and array of points)

I am trying to work out the shortest distance between the user location and from some collection of coordinates received from an API, and then I used Leaflet Routing Machine to workout the routes. I'm ...
2
votes
1answer
60 views

Adding feature property values to filter drop down option in Leaflet, instead of keys?

How would I convert this function to store and utilize (feature.property.id) json values instead of keys in the dropdown menu within a leaflet map? <html> <head> <meta ...
2
votes
1answer
71 views

How to add top and bottom margins to leaflet popup with scroll

I've been customizing Leaflet in order to let popup display more content by adding scrolling to them. Everything works fine except my content touches top and bottom of the popup window. How can I add ...
1
vote
1answer
42 views

Custom icon with Leaflet

I'm trying to add custom icon in Leaflet, but it doesn't show on map. This is my code: <script type="text/javascript"> function fc_MapMod_initialize_99() { var ...
1
vote
2answers
78 views

Seeking Leaflet-compatible tile layers for Palestine?

Where can I find a Leaflet-compatible tileset that correctly displays Palestine with its native borders and Arabic-language placenames? I've searched high and low and I've found all kinds of tilesets,...
1
vote
1answer
51 views

Use self-defined Leaflet identifiers to work with jsTree checkboxes

I have some hierachic structured point-layers in a GeoJSON file using jsTree (ajax) with checkboxes to add them to the map. As I have about 20.000 points structured in 2.000 nodes representing the ...
2
votes
0answers
33 views

How to force caching of image layers in Leaftlet?

I'm working on a weather map project with Leaflet. I have several weather parameters as PNG overlays. For each parameter there's 60 PNG files, representing different points in time. I have implemented ...
1
vote
0answers
34 views

Spatial operations between WMS geometry and client data

I am using geoserver WMS service to visualize some geometry on the map (via Leaflet) which is working fine. Now I have a requirement to perform the spatial operation (say intersects) between two ...
0
votes
0answers
52 views

Auto zoom when uploading shapefile R / Leaflet

I would like to configure an automatic zoom at the canvas of the shapefile layer that I upload. For that it would be necessary that a function automatically detects the latitude and the longitude of ...
1
vote
1answer
19 views

Using custom marker name in Leaflet from external GeoJSON file

I have the following code (which works great): <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="https://unpkg.com/leaflet@1.5.1/dist/leaflet.css" integrity="sha512-xwE/...
0
votes
1answer
23 views

Leaflet.Draw save coordinates

I'd like to save the polyline coordinates. I'm creating it with Leaflet.Draw. The problem is that the coordinates are stored twice. 49.907018,16.324997,49.907018,16.324997,49.818936,16.340103,49....
0
votes
1answer
32 views

Leaflet - how to add time dimension image layers

Javascript beginner here. I'm working on getting a weather animation done in leaflet. A suitable plugin appears to be leaflet.timedimension but I would be open for other options too. I have 60 PNG ...
2
votes
1answer
41 views

GeoServer WFS-Transaction authentication in web browsers

I am developing a webGIS application with editable layers which uses transactional WFS through GeoServer to do CRUD operations in a PostGIS table. I was able to set up the authentication for wfs-t ...
0
votes
1answer
51 views

Using R with Leaflet and Shiny to produce WMS?

I've have been using R with Leaflet and Shiny to produce a web map that is accessible to the public online. It is a real-time air temperature map of Tasmania, Australia based on current Bureau or ...
1
vote
1answer
43 views

Fit the background map to the container

I am using Leaflet library to render states shapes. I am using OSM for background. I am setting noWrap:true for tile layer as I want to see only one background map covering entire world. Now I would ...
2
votes
1answer
49 views

How to make focus on Leaflet marker with a click from another window

I am making a project using Leaflet. I made a script which creates a map with one marker. A click on the map creates a window with the marker coordinates and I would like to be able to click on ...
0
votes
0answers
46 views

Getting wikimapia embeded in Leaflet map?

I have a leaflet map where I want to get wikimapia POI and data inside my map so I could identify some Points of interests and informations which are in wikimapia ,I have a wikimapia kml that loads in ...
2
votes
1answer
37 views

Non-interactive points in Leaflet

I do have a point layer (data from a GeoJSON) and a polygon layer (also GeoJSON) in Leaflet. Both layers are created the same way and I made both layers "non-interactive". Unfortunately the point ...
0
votes
0answers
51 views

Showing global temperature data in Leaflet layers by GRIB2 files?

Wind data already shown in map by danwild/leaflet-velocity Now I want add temperature to map by tiles. How can I convert GRIB2 files to tiles?
0
votes
2answers
59 views

Search control on Leaflet

I would like to have search control for Leaflet, with suggestions to street addresses, like on this image from Google Maps: Some of the plugins I tried (https://labs.easyblog.it/maps/leaflet-search/) ...
1
vote
1answer
60 views

Adding detailed Google Maps baselayer on Leaflet

I know that Google map baselayer can be used in Leaflet like this: googleMap = L.tileLayer('http://{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}',{ maxZoom: 20, subdomains:['mt0','mt1','mt2',...
0
votes
0answers
20 views

Create search control in Ionic v3 with Leaflet and Mapbox style

I'm trying to build some GIS mobile by Ionic v3 using Leaflet map and Mapbox style, but i can create search control to search some data from Mapbox style data that i created before. Here is my map....
1
vote
1answer
56 views

Access geometry.coordinates of sliced vector grid

I am trying to represent LineString GeoJSON as vector tile layer using Leaflet.VectorGrid. But i need to do some interactive by clicking on vector tile layer. but this vector tile layer has came with ...
1
vote
0answers
54 views

Do I need TileServerGL to serve locally stored vector Tiles (MBTiles) in Leaflet? [closed]

Situation: I want to create an offline web app and have locally stored .mbtiles (vector tiles) which I downloaded from Open Map Tiles (educational purpose of the project) with a size of about 20 GB. ...
2
votes
2answers
53 views

Getting all items for selected period using Leaflet.TimeDimension?

I use the leaflet plugin: leaflet.TimeDimension Is it possible, when choosing a period of one year, to receive all elements associated with this year when displayed? Currently, when selecting a 1 ...
0
votes
1answer
82 views

React-Leaflet: Marker has wrong position after zoom out

When I show a marker in the center of the map it is OK. But when I zoom out, the marker is like staying at the same place. Finally its position is very wrong. Why is it not moving together with the ...
1
vote
2answers
67 views

Bouncing markers when hover over sidebar

I would like the markers on my leaflet map to bounce when hover over corresponding list-item in sidebar. How to connect markers and list-items. List-items and popups all generated dynamically, their ...
0
votes
0answers
48 views

Leaflet routing machine waypoints with numbers

Is it possible to display numbers near waypoints on map? I create multiple routes in loop and passing waypoints via array. Routes get painted with Leaflet Routing Machine. I want to show number of ...
0
votes
2answers
46 views

Leaflet: Bounds from getBounds are changed after rendering

Leaflet Version: 1.4.0. At the time of render, we are saving bounds by calling getBounds() on the layer. After the map is rendered, zoomend event is called and the bounds captured are different from ...
1
vote
0answers
17 views

Leaflet.TimeDimension and Leaflet.Marker.Cluster

I am trying to combine L.MarkerClusterGroup with L.TimeDimension: basically, I would like to load a geoJSON and control the appearance and disappearance of points with L.TimeDimension, but in such a ...
1
vote
0answers
49 views

Make POST request for WMS in Leaflet for big values of cql_filter

I am passing a spatial query such as CONTAINS(geom, POLYGON((// geometry))) in the cql_filter, but for big polygons GET request the allowed URI length is violated and hence my requests is getting HTTP ...
0
votes
1answer
56 views

Leaflet Routing Machine show option doesn't work

I am adding route to the map and I want to hide instruction (turn left, turn right etc.) but I want to show them later. As I can see there is parameter show for that. If I set show: false I see white ...