Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [leaflet]

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

-4
votes
2answers
30 views

Leaflet-JS Not sure what is wrong with my script below

I have posted a screenshot of my index.html and JavaScript file. The problem is that It doesn't display any webmap. the only thing I can see is the head(h1 from my html. Any thoughts on this?
-1
votes
0answers
7 views

Adding z coordinates to geometry of linestring geojson file [on hold]

i have calculated elevations of each point in that geojson file, but i don't know how to bind/insert these elevations values as [lat, lon, height]. I have extracted each point of lines in a shape ...
1
vote
1answer
35 views

Using Leaflet elevation profiles with multiple GeoJSON features?

I have a GeoJson file that contains many routes, i need to show each route on an elevation profile via Leaflet.elevation plugin, in need to when i click on a route it's profile show on the elevation ...
1
vote
1answer
2k views

Changing list-item css class using ng-class when mousing over Leaflet Map Markers?

I have an app with a map/markers on the right and a list-item menu on the left with info about the markers (like Yelp or Foursquare). With some of my beginner hacking, I got the hover events to sort ...
1
vote
1answer
35 views

Changing anchor point for popup without marker using Leaflet?

Is it possible to change the position of the anchor point for the popup without using markers? I was testing with this example. This code shows a popup, but I want to adjust the position of the ...
1
vote
0answers
12 views

Creating a rectangle using leaflet / turf.js

I have written some code which creates a rectangle at the position of the user's cursor. There does not seem to be any method to do this in turf.js itself. And of course using the latlong-based ...
0
votes
0answers
20 views

Leaflet WMS layer label disappears on zoom [duplicate]

I am populating a tileWMS layer on my map (also created through Leaflet) through Leaflet from GeoServer which is working fine but the issue I am facing is with visibility of labels. On various zoom ...
0
votes
2answers
31 views

Displaying GeoJSON using Ajax and Leaflet?

I have been trying for days to load a GeoJSON file using Ajax and Leaflet. I can get the map & index.html to load using an Apache server and such but the GeoJSON itself does not show up. Here is ...
0
votes
2answers
24 views

Changing a markers location at set intervals

I am trying to plot coordinates of a marker using a GeoJSON feature. I am able to plot my points fine but my issue is, when the interval happens the old marker stays on my leaflet map rather than ...
3
votes
2answers
1k views

Querying PostgreSQL with GIS to get GeoJSON for GeoJSON tile layer?

I have a PostgreSQL database with one table like the following: CREATE TABLE post_pl ( gid serial NOT NULL, zip character varying(5), zip_n integer, city character varying(50), geom ...
1
vote
0answers
35 views

Draw a polyline around a route to act as geofence with leaflet routing machine [on hold]

I am using leaflet routine machine to get a route between 2 points. I want to be able to draw an invisible polyline around the route and use this as a geofence and if the user goes out of the bounds ...
3
votes
0answers
40 views

Function fires despite conditional query in leaflet-map

In a map built with Leaflet I created a button to export and download data as geoJSON drawn before by the user with Leaflet.draw. To prevent an empty download, I am querying the existence of data. ...
2
votes
2answers
37 views

Making button clickable to perform function in Leaflet?

I am trying to create buttons that will initiate a flyTo. I can click the buttons on the page but they do nothing action functions: <script> function Action(){ map.flyto([43.372000,...
2
votes
3answers
526 views

Is it possible to map a leaflet provider (precipitation) on top of a polygon in an interactive map?

I've just started using the leaflet package in R to create interactive maps and I'm wondering if it's possible to plot one of the leaflet providers on top of a plotted polygon rather than under it as ...
-1
votes
0answers
12 views

Access html5 camera api and attach photo from camera to leaflet marker [closed]

Is it possible to access the html5 camera api of Android or IOS and attach the photo to a circle marker within leafletjs
1
vote
1answer
40 views

Different icon of the nearest marker to current location in Leaflet

I'm working with Leaflet and JavaScript for the first time, so I feel a bit lost here. I have an app that displays user's location and a couple of points of interest from a GeoJSON on a map. The ...
2
votes
3answers
117 views

I'm trying to add my local GeoJSON files to my Leaflet web page

I'm quite new to JavaScript and I have been trying to add my GeoJSON files to a web page. I can't seem to figure out how to get the GeoJSON to actually load. I've checked it using GeoJson.io and it ...
0
votes
1answer
30 views

Esri Leaflet identify() only on added layer from MapService

I try to identify features only from the wastepit layer. In this example I am adding two layers: wells and wastepit. I am only calling the identify function on the wastepit layer but I still get ...
3
votes
1answer
39 views

Leaflet access dynamic layers globally

I am adding layers to my map dynamically based on whats available in the MapServer. I am looping over them so I can add them in the LayerControl. My issue is that I dont have access to the layers ...
2
votes
1answer
21 views

How hide leaflet tooltip on mobile device

I would only display a tooltip on a device without a touchscreen. A popup and a tooltip will be displayed on your mobile by clicking on the point. I would like to see only popup var ubytovaci = L....
0
votes
0answers
35 views

Leaflet var to php

I have a function when I click on the marker: function onMarkerClick (e) {          id1 = "something";          $ .post ("content.php", {id_a: id1}, function (result) {              alert (result);   ...
1
vote
1answer
19 views

GeoServer pre-generated tiles not working

I have a GeoServer running with a layer that I can load in leaflet using WMS. Currently "caching on demand" seems to work: If I load the map for the second time it loads much faster than loading it ...
3
votes
1answer
5k views

Leaflet circleMarker changes with zoom

I was under the impression that L.circle changes size with zoom, but L.circleMarker should remain the same radius as you initially set? I've setup an example here, and whichever I choose the circle ...
0
votes
1answer
25 views

Update attributes of Esri FeatureLayer from Leaflet

I have a shapefile hosted as Feature Layer at ESRI Server. I create a Leaflet application where I want to enable an attributes update of my Feature Layer (field 'Status'). I have customized a popup ...
2
votes
3answers
693 views

Is there a Cluster convex hull implementation in OpenLayers?

In this leaflet example. When hovered over a cluster marker, it shows the bounding area of the clustered features which is known as convex hull. Is there a way to reproduce it with OpenLayers?
0
votes
1answer
47 views

How to read a WFS published through QGIS server with Leaflet

I would like to read a WFS published using QGIS server, with the plugin Leaflet-WFST but an error occurs when the plugin is trying to read the geometry. Error : uncaught exception: unknown child ...
3
votes
1answer
344 views

Receiving data from php script for geoJSON TileLayer?

I want to get geo data as geojson for geojson tile layer requests in leaflet. I set up a geojson layer like this: https://github.com/glenrobertson/leaflet-tilelayer-geojson/ A php script answers ...
0
votes
0answers
41 views

How to create a single multi-option Leaflet filter from multiple columns of R data frame in Shiny?

I am creating a Shiny Leaflet app in R where am trying to display locations (markers) that correspond to a multiple dropdown filter. The data I have has many columns, but basically looks something ...
1
vote
1answer
42 views

Creating popup forms with Leaflet (L.Draw). How to implement listeners for radio buttons and other input groups?

I am attempting to create a map-based survey using Leaflet popups and specifically L.Draw, because I want users to be able to insert markers where ever they want to and then answer certain questions. ...
2
votes
0answers
37 views

Adding points to map with Leaflet using .forEach function

Trying to add an array of points to a map with a Leaflet with .forEach. I thought this should work, but alas, it does not: var jsonData = [ { "LNG":-75.16472099534634, "LAT":40....
0
votes
0answers
49 views

Leaflet Cannot read property 'addLayer' of null

I am creating a leaflet map with some line strings that I pull in as geoJSON via ajax. Works fine on areas with more line strings, but areas with less than 25 line strings it errors out claiming the ...
0
votes
0answers
73 views

Leaflet Mobile Performance (A Couple of Polygons)

I wrote a small Angular app with leaflet.js. In desktop browser scrolling and dragging speed is good but on mobile browser, performance is painfully. There are 8 polygon and 129 circle marker on the ...
2
votes
1answer
74 views

Change separator of attributions in Leaflet?

Is there a way to change the comma shown in the image below to | I used the QGIS plugin QGIS2WEb to create the Leaflet map and wanted to link to the source of the information. Currently, in the HTML ...
1
vote
2answers
87 views

Passing only coordinates on click “.ie. remove text” using Leaflet?

Below is my map script, everything is working pretty fantastic! However, when I click and it sends the e.latlng to the form it is sending LatLng(38.47939, -105.86426) for example. I would prefer ...
1
vote
1answer
29 views

Using L.Control.Search and L.markerClusterGroup

I am trying to use L.Control.Search and L.markercluster to make a searchable cluster of ~4400 address points. I have tried two separate ways (based on examples I have found) but not yet been ...
0
votes
0answers
15 views

.leaflet-control-layers-expanded style control appearance

This might be kind of a nothingburger, but it's nagging enough that I can't fix it and I'd like to know why this is happening!!! I'm also wondering if this little bug might be a sign something isn't ...
0
votes
1answer
154 views

Automatically refresh Leaflet Markers from MySQL

I have a leaflet map that loads marker details from a MySQL database. I have a timer that clears and reloads the layers (and therefore markers); however; it doesn't seem to be refreshing the data. ...
0
votes
1answer
37 views

Leaflet + Polymer 2 map loading with distorted tile

I am struggling for some time now to get the leaflet map loaded properly within Polymer 2. I have searched various threads in SO: this, Github: this, this and several other posts, unfortunately still ...
0
votes
1answer
662 views

Leaflet: popup showing information on the polygon [closed]

I have a Leaflet map. To the map I load two JavaScript files (A.js & B.js) which both consist of only polygons. Now my aim is, that when I click inside Leaflet on one of the polygons, that I get a ...
2
votes
3answers
725 views

Is it possible to have a Leaflet control with large images / icons

Im trying to create a map where the layer control have large icons or images, and the "buttons" are located in the bottom of the map and not on the sides. I have used the simple controls until now. I ...
-2
votes
2answers
40 views

Keep the zoom level and the Center of the screen view when reloading a web page [closed]

<script> function init(){ var osmAttr = '&copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/"&...
2
votes
2answers
124 views

How to add a dynamic number of pictures into a Leaflet popup?

I have a huge dataset of playgrounds I want to represent in a Leaflet map. Each playground has a different number of photos (between 1 and 13) connected as an attribute value. The value contains the ...
2
votes
0answers
24 views

Leaflet layerGroup in ListMarkers

I am using the Leaflet List Markers Plugin for showing all features currently visible in the map in a list. Adding a single L.geoJson layer is no problem and works fine. Now I am using multiple ...
4
votes
3answers
2k views

Does leaflet support KML Ground Overlays?

I found an example showing KML overlays at http://harrywood.co.uk/maps/examples/leaflet/kml.html but it only plots vector layer using polygons. Is there any way to plot Ground overlays of KML (like ...
0
votes
2answers
72 views

Updating popup of a Leaflet Polygon

I am trying to update a popup for a polygon that I have drawn with Leaflet.Draw. Now I understand that to set a popup to a layer I just created, it's all fine. I can also get the id of that layer I ...
2
votes
1answer
52 views

Unable to Zoom WMS above 20 in Leaflet?

I have multiple WMS layers. One of the layers is from a local GeoServer (UAV generated GeoTIFF). I am unable to zoom GeoTIFF up-to it's full resolution. How to enable deep zoom in to WMS above 20% ...
2
votes
2answers
95 views

What does the default crs being EPSG:3857 in Leaflet mean?

In the documentation of leaflet, it says the following about the projection that is being used: L.CRS.EPSG3857 The most common CRS for online maps, used by almost all free and commercial tile ...
0
votes
2answers
214 views

Why my tooltip cannot shown when I hover over layer in leaflet.js?

I want to use tooltip on my polyline to show its features and I use this code: var boroughs = L.geoJson(null, { style: function (feature) { return { color: "black", fill: false, ...
0
votes
0answers
28 views

How to listen to touch events on Leaflet GeoJSON linestrings?

I'm using react-leaflet to display a map with GeoJSON linestrings and points. My mouseOver, mouseOut, and click events work fine with a mouse. However, I can't get the tap or touch events to work on ...
0
votes
1answer
25 views

Updating onEachFeature property of GeoJSON in Leaflet?

Here's my code: var eurojson = L.geoJSON( eurojson,{ onEachFeature: onEachFeature, style: EU_color }); var econjson = eurojson; econjson.setStyle(Econ); When I initialize econjson variable, I ...