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

learn more… | top users | synonyms (1)

1
vote
2answers
66 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
35 views

Hide/Show leaflet markers based on specific values

I have a Python list of dictionaries with a number of IPs and "Scores" for each IP. I'm adding them to my front end map / leaflet using jinja2 like so: var map = L.map('map') ...
3
votes
1answer
49 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
2answers
61 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 ...
0
votes
0answers
52 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 ...
0
votes
1answer
40 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 ...
1
vote
1answer
49 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 ...
1
vote
1answer
136 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 ...
0
votes
1answer
155 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 ...
1
vote
1answer
41 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
0answers
29 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 ...
0
votes
1answer
26 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
1answer
47 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 = ...
1
vote
1answer
45 views

Sortable list of layers

I want to create a sortable lists of layers using jquery ui. I'm trying to use .setZindex() and .index() method. I think that index of <li> does not refresh after order changing. I'm not ...
0
votes
0answers
38 views

Leaflet - layer tree plugin

Does anyone know an appropriate plugin for leaflet as shown in the following image. I tried the leaflet-layer-tree-plugin, but the result is not what I want. Any help or suggestions?
0
votes
1answer
17 views

Add additional markers to existing featuregroup in Leaflet

It is possible to add additional markers to an existing featuregroup after it has already been added to the map?
0
votes
1answer
25 views

Change marker within leaflet map when loading data from geojson file

This section of code adds markers to my map (it works), how can I change the marker to a different icon when dealing with geojson? var cycleracks = $.getJSON('cycle-racks.geojson', function (geojson) ...
1
vote
1answer
60 views

How to create a heatmap with numbers using Leaflet map?

I wish to create a heatmap like this one at http://www.trulia.com/local/san-francisco-ca/tiles:1|points:1_crime With the number changes at different zoom level - the number can appear in a ...
1
vote
1answer
22 views

Labelling Icons in Leaflet

I am using leaflet to create a set of points, but I want to view which one was plotted first, last, etc. Is there way to label them such that when the first point is plotted, it will plot a circle ...
0
votes
2answers
35 views

HTML file not loading for CartoDB.js using Leaflet

I am trying to create a web map that uses a layer hosted on CartoDB and a basemap created in Mapbox studio. Never mind adding the basemap to the L.map, I cannot get the cartoDB layer to draw at all. ...
0
votes
2answers
51 views

Leaflet: Capturing points for features inside circle

I'm using the leaflet draw tool to create a circle and then finding the points inside the circle. My data is from GeoJSON, and the code works as far as figuring out how many points are inside, but I ...
3
votes
2answers
121 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.
0
votes
1answer
37 views

Handling Errors with Esri Leaflet Dynamic Map Layers

I have an application that is using ESRI for leaflet to pull in MapServices. I can successfully pull in map services and render in my application. However, sometimes the map services return an error ...
1
vote
0answers
13 views

Modify sidebar information caused by marker click [closed]

First time poster here, hopefully someone can point me in the right direction! Pretty new to Leaflet, HTML, and CSS in general so this project has been a great learning experience for me but I've ...
1
vote
1answer
104 views

How to add OpenSeaMap tiles as an overlay on top of osm base map with Leaflet?

After generating the OpenSeaMap tiles, I tried to add them as an overlay upon the openstreet basemap. The idea is after generating the OpenSeaMap tiles to serve them as "static" tiles to the client, ...
6
votes
2answers
100 views

Leaflet marker/icon help

I am trying to get the default marker NOT to show, but it's coming up WITH the icon that I want, so I have a marker and icon like this: I'm getting my data from a OSM nomination search result. if ...
0
votes
1answer
58 views

Loading Leaflet raster layers asynchronously before adding them to the map?

I am working on a web application where users can view sequences of 5-10 GeoTiffs overlaid on a map, and played like a slideshow - show the first Geotiff, wait a few seconds, show the second, and so ...
0
votes
0answers
36 views

Leaflet - invalid map extent

I have a Leaflet map with a GeoJSON polygon overlay. When clicked on a polygon, map is suppose to zoom to the selected polygon: this.map.fitBounds(layer.getBounds()); I'm experiencing strange ...
4
votes
2answers
122 views

How to make both hover and click popup work?

I am pretty new to all of this... I want to have a hover/mouseover AND click popup work on my geojson layer. Here is the code so far, but I don't know where to include the hover without messing up the ...
4
votes
1answer
74 views

leaflet GeoJson vs polyline

Is there any real advantage in using L.GeoJson instead of Polyline when drawing paths in a map powered by Leaflet? I know that GeoJson can attach additional options. It is also possible with ...
-1
votes
1answer
66 views

export shapefile [duplicate]

I want a button "export" as i clicked on it the shapefile should be downloaded along with it's all files shp, shx, prj, dbf as zip folder. My project is GIS based in which i have two main tasks: 1. ...
1
vote
0answers
38 views

Export ShapeFile from layer file lyr

I want to export shapefile from geojson. I am getting the all data of dbf file in console. My project is based on GIS. I am using LeafLet for that. How can I get a shapefile and it's all supportive ...
2
votes
0answers
62 views

Alternative basemaps for leaflet

I am interested in creating a web map application, that will display a map of my country and various files (.tif, shp) on top of it as layers and i decided to build it on top of leaflet. So when i ...
1
vote
1answer
52 views

Leaflet : load & remove layer at specified interval time

I want to load and remove a layer in a specified interval of time. I make it blink with a random color function associate to my layer style. I can load this layer multiple times, unload it in a ...
2
votes
2answers
115 views

Simplify GeoJSON by retaining external boundaries (clustering)

I created a website (http://www.cartescolaire.paris) that basically loads a GeoJSON and displays it on a map using Leaflet. This geoJSON is pretty large (over 2 Mb), the loading time can be very long ...
4
votes
0answers
46 views

Is it possible to use a raster::click event within an interactive leaflet map?

Data Download: https://www.dropbox.com/s/f849ra8l6umo9d8/crops.tif?dl=0 I have various raster images of the world that I would ultimately like to plot within an interactive leaflet map; an example is ...
2
votes
1answer
48 views

How to keep vector layer on top of all layers despite toggling order?

How do I keep a layer on top of my other layers despite the order it is toggled by the user? In this example, I've set up two layers named layerONE and layerTWO. How do I keep my layerTWO (red ...
1
vote
0answers
47 views

Leaflet custom info control update with extra parameters

I used custom info control to show information.The below code is working: var info = L.control(); info.onAdd = function (map) { this._div = L.DomUtil.create('div', 'info'); this.update(); ...
0
votes
2answers
39 views

Tweaking location of zoomControl (cartodb.js)

I have succeeded in creating a header outside of the CartoDB UI, but the header is blocking the zoom controls, as can be seen below. Is there any way to modify the zoom control location to adapt to ...
3
votes
1answer
100 views

Leaflet pop-up does not work with Geojson data

I have a geojson file(Polygons).I want to display it on a leaflet map and when user clicks on a polygon, a popup with an information should be visible. The information is 'type'. I am able to see the ...
0
votes
1answer
62 views

Does leaflet support user defined Layer identifiers

It would be nice to be able to check for a layer presence or remove it without having to keep an explicit reference to it. To that extent I would like to use ad id for the layer that I can compute ...
2
votes
1answer
54 views

Update Bootstrap Switch with Leaflet Layer Group

I have this JSFiddle that shows two example layers that can be toggled on and off using the Bootstrap Switch to add and remove them from the map; this works fine. The problem I am having is updating ...
1
vote
0answers
35 views

CartoDB: how to let users update data from the map infowindow [closed]

In cartoDB, I have a map showing public lands in a German city. I want to integrate a form into the cartoDB infowindow to let the user update the data table. How can I pass the values from the form ...
3
votes
1answer
85 views

Leaflet Choropleth Map

I'm trying to create a choropleth map using leaflet. When running the code below the map just comes up with each county being the same color. How do I get each county to be colored based on the data ...
0
votes
1answer
77 views

Querying feature info for L.esri.dynamicMapLayer “bbox must be specified”

I have a Leaflet map in which I am displaying an Esri ArcGIS REST layer, using L.esri.dynamicMapLayer(). The code that initializes this layer is passed the URL to the service and a comma-separated ...
0
votes
2answers
60 views

Leaflet pass geoJson parameter to onEachFeature method

I created geoJson object as below: var geoJson= L.geoJson(groupingLevelType.type, { style: style, onEachFeature: onEachFeature }); function ...
0
votes
1answer
57 views

JSONs made from shapefiles are not plotting (using folium or Leaflet alone)

My goal is to plot two shapefiles as layers on an interactive map. The files I'm using live at https://github.com/AnnaMag/maps. I transformed shapefiles to .geojson using ogr2ogr -f ... e.g. ...
0
votes
0answers
12 views

TimeDimension in R, leaflet [duplicate]

it's possible to do this this with R,leaflet ? any suggestion please?
3
votes
1answer
134 views

Leaflet: How to style my polygons in a GeoJSON layer?

I am trying to figure out why my polygons are not changing color based on a value I have in my GeoJSON. I've set up a hypothetical test here to replicate my issue here. JSFIDDLE link here My data ...
2
votes
1answer
51 views

L.esri.query - where is it?

I have a website that is displaying a MapBox map, using Leaflet. One of the layers is generated from an Esri ArcGIS Rest interface, using Esri's Leaflet plugin: https://esri.github.io/esri-leaflet/ ...