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

learn more… | top users | synonyms (1)

0
votes
1answer
33 views

Leaflet control layer update

I am using this example to setup a control layer. http://leafletjs.com/examples/layers-control.html L.control.layers(baseMaps, overlayMaps).addTo(map); How do I just update overlayMaps with latest ...
0
votes
1answer
24 views

Add WFS layer(json) in leaflet using leaflet layer tree control

I'm using the layer tree control to manage the display of layers. When I add WMS services, it works fine. But when I add WFS , this is not loaded. I'm using the leaflet layer tree plugin code and ...
1
vote
0answers
27 views

Changing layer color with a button click

I am trying to change the color of my map layer when filter buttons are selected. So, the goal is: the user sees all of the data in one color. Then, when they click on a filter button, only a subset ...
1
vote
1answer
66 views

Leaflet GeoJSON with projected coordinates (3857)

I am trying to get a GeoJSON with projected coordinates to show in Leaflet. I have no problems loading GeoJSON with lat/lng (EPSG:4326). Here is a fiddle where I load the GeoJSON with unprojected ...
0
votes
1answer
625 views

How to add layers and update layer control dynamically : leaflet

Introduction I am working with the lealflet api, where user can draw shapes to map(image)... Initially the layer control(handling 1 layer) is added for base map using imageoverlay...... ...
0
votes
1answer
19 views

How to make a WMS GetFeatureInfo request in Leaflet?

I am trying to make a WMS GetFeatureInfo request using Leaflet. I can not find something in the documentation to describe this process. Can you please provide with an example demostraing how to do ...
0
votes
1answer
33 views

Accessing HTML using jQuery within LeafletJS popup.

So I want to add some HTML code to a Leaflet popup, but I also want to be able to to perform some jQuery functions when this HTML is clicked, like so: .bindPopup( "<button id='clickHere'> ...
2
votes
1answer
47 views

Mapbox - Images as Maps

In the past, by following this tutorial by Tom MacWright, I was able to in a few steps display any jpeg images as an interactive map with Mapbox. The steps are summarized below: Run a python script ...
0
votes
0answers
10 views

Stop leaflet popup on nodata areas

I'm working with leaflet.js and some wms services. I've been playing around with L.TileLayer.BetterWMS.js but am getting the same problem with the standard leaflet.wms.js plugin. I would like to ...
0
votes
0answers
105 views

How to draw custom lines and animate markers on it : leaflet

Introduction: I am working with the leaflet api, i have implemented a script which will put marker on map(onClick) and animate marker to the position i have set..... Problem I have to ...
0
votes
1answer
530 views

How to use leaflet-search for a geojson feature property?

I'm trying to use the leaflet-search plugin to search for a specific geojson property (i.e. 'Name'). The trick part of this is I want to perform a search on a Geojson file thats loaded in via the ...
4
votes
2answers
351 views

How to remove a single marker in Mapbox?

I have a simple Marker added to map like this: var x = L.marker([50.5, 30.5]); x.addTo(map); Now how can I hide/remove x? I searched the API docs for a Marker.remove() method, but couldn't find any. ...
0
votes
0answers
34 views

How to return output of WMS/GetMap (Geoserver) request through an API call?

I am working on a web mapping application which is build on Leaflet and Angular JSP libraries and relies on ArcGIS Map Services. We get token from ArcGIS's gettoken API through a WebAPI and that token ...
1
vote
0answers
30 views

Leaflet Mobile Not Working

Trying to get this to work on a mobile device. Works fine on a computer. Anybody have any suggestions as to why it wont show up on my phone? </body></html> ...
0
votes
1answer
43 views

How can i an add image overlay depending on the options in the polygon properties in a leaflet map?

I have a multi-polygon geojson file ( mapInfo ) that has one of the properties named "field_hazards". The hazards include "gale/storm, heavy rain, thunderstorm and Freezing rain "How can i an add ...
1
vote
1answer
988 views

Submit a form from within a leaflet popup?

I want to submit a form from within a leaflet popup simply using javascript and geojson. I am essentially collecting attribute information in the form and then I want to process the information into ...
0
votes
1answer
59 views

Text + Chart inside pop up window in Javascript

A similar question had been posted in this thread : Chart inside pop up window in Javascript I'm trying to do the same, but i would like to add others things in the popup (like text, feature ...
2
votes
0answers
48 views

How to instantiate a new map with proj4leaflet projections from a Bootstrap dropdown menu

I'm currently working on a Leaflet website that will be able to display GPS-Tracks with different projections. Now I'm trying to implement a dropdown menu based on Bootstrap, where I can set different ...
0
votes
2answers
51 views

Layer not staying on top of all other layers

I am trying to keep a specific layer named popDensity on top of all the other layers on my map despite what other layers I may click in the layers control. I am using the Leaflet overlayadd event to ...
0
votes
2answers
19 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 ...
0
votes
1answer
29 views

LeafletJS: How to hide legend when layer is clicked?

I am trying to show/hide a legend when a certain overlay is clicked, but can't seem to get the legend to hide when the overlay is unclicked. Here's my sample setup: //establish the data var ...
1
vote
1answer
69 views

LeafLetjs: GeoJSON invalid object error

I am getting GeoJSON data from postgresql, but it seems to be invalid. How can I validate it? After getting GeoJSON format data I want to put on map for projection. I am using LeafLet, java EE, ...
19
votes
5answers
10k views

Visualizing large datasets with Leaflet

When using Leaflet to visualize a large dataset (GeoJSON with 10,000 point features), not surprisingly the browser crashes or hangs. A sub-sample of 1000 features from the same dataset works ...
7
votes
2answers
562 views

Leaflet change color dynamically

I am new with leaflet and I need help to change the color of a polygon on a choropleth map dynamically. In my website I have an slider, and depending on the position of the handle, the colors of the ...
0
votes
1answer
61 views

Problem with same legend for two layers in Leaflet

In Leaflet, I have two layers (treated as overlays) and a single legend that I want to appear when any of them is checked in the Layer Control panel. If they are both checked, I don't want it to ...
3
votes
2answers
1k views

Easy way to render TileMill tiles in retina mode with Leaflet?

I have a few quick little map websites that run straight off TileMill, without pre-exporting. They usually have code like this: L.tileLayer('http://example.com:20008/tile/MyMap/{z}/{x}/{y}.png', ...
0
votes
0answers
50 views

Leaflet self-intersecting polygons display

Is it possible to set colors of the actual intersections of self-intersecting polygons in Leaflet? Example of such self-intersetions can be found on the pic below, the transparent triangles inside of ...
0
votes
2answers
110 views

How to display geotagged photos in leaflet

There is awsome plugin of displaying geotagged photos in leaflet Photos on leaflet I used the picasa photos implimentation when I implemented the plugin for my picasa public album photos link in ...
3
votes
1answer
231 views

Control to select data source on Leaflet map

I am building a map using leaflet. My data source looks something like this: var districts = {"type": "FeatureCollection", "features": [ {"type":"Feature", "geometry": ...
0
votes
1answer
55 views

Drawing arcs/curved line/arrows with Leaflet using method other than arc.js?

I've been trying to find a good way to draw arcs or even arrows dynamically with Leaflet.js, but I haven't come up with much. I tried arc.js, however I was having problems with that approach, and I ...
4
votes
2answers
1k views

Search and zoom json features in Leaflet

How can I add search box to map that allows user to search>zoom to polygon name. If there are 100 polygons, user can type name of polygon (i.e., Symantec) then map zooms to matching county?
0
votes
1answer
60 views

Leaflet layer tree plugin - order layers

I am creating a leflet layer tree control with some baselayers and overlays, and I'm having problems with the order of the layers. When a change a base layer, this overlap the overlays. This is the ...
1
vote
2answers
68 views

Leaflet Layer Control problem

I am struggling to find a solution to add my two basemaps (Esri Imagery and OpenStreetMap) and one external GeoJSON to show up on the Layer Control panel in Leaflet. Here is the block of code: ...
0
votes
1answer
61 views

Get array of LatLngs from ArcGIS feature layer polyline using Esri-Leaflet

Leaflet has a method built into the polyline class to return an array of all LatLng coordinates of the line. It would look something like: var latlngArray = polyline.getLatLngs(); Esri-leaflet, the ...
0
votes
2answers
62 views

Leaflet JS Plugin

I'm having trouble getting a simple java script plugin to work on my script. I'm trying to get the measure tool to work. The little toolbar pops up but it doesn't do anything. When I run it I get the ...
3
votes
1answer
51 views

How to make WFS request using LeafletJS

In the past I have used OL extensively in order to make WFS requests to Geoserver and add layer on a map. Now I am trying to learn LeafletJS and I want to do something similar. I have made a WMS ...
0
votes
1answer
41 views

How to access secured wms server in leaflet?

I browsed regarding this question and I couldn't find any better solution.This link has some information for openlayer but not for leaflet.How to access secured wms via leaflet in java script?Do I ...
0
votes
0answers
59 views

How do I store GeoJSON format in Firebase so it can be used for Leaflet GeoJSON

I am new with Firebase, Leaflet, and GeoJSON .. I have a question, how to store data with GeoJSON format in Firebase, so it can be retrieved and used for leaflets GeoJSON to display marker(s). I know ...
1
vote
1answer
51 views

Loading WMS layer from USGS WMS server using Leaflet?

I am trying to load wms layer using leaflet from usgs wms server but I am getting an empty image. I have gone through Problem loading WMS layer from external server in Leaflet link but it doesn't ...
0
votes
2answers
4k views

Loading WMS layer from external server in Leaflet?

I'm trying to use the WMS service documented here in a leaflet map. The documentation shows an example for openlayers: var wms = new OpenLayers.Layer.WMS( "Population Density", ...
2
votes
1answer
56 views

Leaflet marker is not displaying

I am currently having slight problem on displaying marker in the leaflet. I have used the following codes on displaying marker and map, however the map is displaying flawlessly but the marker is ...
1
vote
1answer
148 views

Leaflet Routing Machine: how to export route details and coordinates in JSON / GeoJSON?

I need to export / save the route details found using Leaflet Routing Machine in JSON or GeoJSON format. I've tried to use var routeArray = new Array(); routeArray = control.getWaypoints(); alert ...
7
votes
1answer
6k views

Disable leaflet interaction temporary

How can I temporary disable zoming/draging the Mapview in Leaflet.js Tried so many ways but without any luck. It's important to make it temporary and I also need the option to enable again.
0
votes
1answer
175 views

Leaflet Routing Machine: how to initialise map without waypoints loaded?

I'm starting to take my first steps using Leaflet Routing Machine. Everything works fine if I use load waypoints when I create my L.Routing.control and add it to the map. Now I'd like to start my map ...
3
votes
2answers
132 views

Placing controls outside map container with Leaflet?

Can someone tell me how I can place controls outside of the map content with Leaflet? In this case, I just want to place the layer switch control outside the map object.
1
vote
1answer
46 views

esri-leaflet edit multiple featureLayers

I'm trying to use the esri-leaflet example on editing (https://esri.github.io/esri-leaflet/examples/editing.html) to edit two different featureLayers. First when I add a point with leaflet draw, I ...
0
votes
1answer
28 views

Trouble getting leaflet-label plugin to work on geojson file

I cannot figure out how to get labels on my featureLayers to show in my LeafLet map for a mapbox featureLayer using the leaflet-label plugin. I thought all i needed to do was add .bindLabel('Look ...
0
votes
0answers
30 views

Zoom animation resets to pre-animation state

I want to animate the zoom in/out behaviour of a custom Leaflet 1.0 WMS layer. It sort of works, but the animation appears to undo itself just prior to the new image being displayed. I am wondering ...
7
votes
3answers
3k views

Click Events with Leaflet and geoJSON

How do I attach a click event to a geoJSON that then executes an Ajax function when clicked. I looked into onEachFeature but that executes when the geoJSON is loaded, not when clicked, thus executing ...
0
votes
1answer
48 views

How to highlight leaflet marker cluster on mouse over?

Is there a way to highlight a leaflet marker cluster when mouse over as you can do for a simple marker? // ADD YOUR BASE TILES var baseLayer = ...