Questions tagged [leaflet]

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

Filter by
Sorted by
Tagged with
1
vote
2answers
82 views

Add popup with GeoJSON data

I want to display popup with the data item, such as: name, coordinates, stationID, Attribute. But my code has some problem that can't run. <html lang="en-US" xmlns="http://www.w3.org/1999/xhtml"&...
0
votes
2answers
58 views

Getting Leaflet map to work offline?

I am interested in how to create a base map for Leaflet offline with XAMPP. Is this just a picture of what you draw from the Internet and then specifies the path with L.tileLayer? I'm still a bit ...
0
votes
0answers
38 views

Why GeoJSON is gotten by Leaflet, but does not display?

I WFS request from Leaflet to GeoServer is successful (200). But no features have been displayed. Response of request is big GeoJSON with features. What is the problem and what is wrong with my code (...
0
votes
2answers
51 views

GeoServer layers not visible in layer switchers

I added both WFS and WMS layer from GeoServer. I need to have the layer switchers for these layers. But the layers are not visible in layer switchers. <!DOCTYPE html> <html> <head>...
2
votes
0answers
41 views

Cutting off polygons outside of border in Leaflet?

I have an application where I create polygons based on values I calculate from points on a map. The polygons are then overlayed on top of a city using a single leaflet FeatureGroup. Another one is ...
0
votes
0answers
41 views

GeoJSON from react-leaflet doesn't render the layer over the map [duplicate]

I have a GeoServer running on my localhost also I have a react app which consumes a WFS service to get a GeoJSON data to render as a layer over the map. These are my dependencies on my package.json "...
0
votes
0answers
68 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
21 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
59 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"&...
2
votes
2answers
66 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....
2
votes
1answer
77 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
30 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
56 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
33 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
67 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
62 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
40 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
36 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
57 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
16 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
41 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
45 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
84 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
73 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
134 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
50 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
105 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
58 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
41 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
60 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
23 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
40 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
47 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
47 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
73 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
142 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
97 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
59 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
58 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
78 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
109 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
122 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
36 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....
2
votes
1answer
74 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
90 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
55 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
196 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
89 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
120 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 ...