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

learn more… | top users | synonyms (1)

1
vote
1answer
210 views

A problem with event firing upon mouseout

I'm trying to create a point map that displays information about a point in an info box upon user mouseover and changes the styling of the point. On mouseout, I want the info box and marker styling to ...
3
votes
2answers
995 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
40 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
94 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
222 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
197 views

How to draw a rectangle on a Leaflet map from GeoJSON data

I am trying to draw a rectangle on a Leaflet map with JSON data which looks like this. var geojsonfeatures = {"type":"FeatureCollection","features":[ {"type":"Feature", ...
0
votes
1answer
26 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 ...
1
vote
1answer
204 views

Is there any method to retrieve SQL queries into a GeoJSON file using JSP?

I want to display the contents of my PostGIS database of various shape-files in leaflet pop-up dynamically. I know there are static methods available that retrieves attributes. But I need to by ...
1
vote
1answer
755 views

How can I project geojson borders on the google earth tiles in leaflet?

I started working with leaflet and google earth tiles. I want to add borders on my map so I tried to use the countries geoJson Data as a layer on the map. The problem is that the json borders ...
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?
1
vote
1answer
215 views

Leaflet popups events through CartoDB

How I can use the leaflet popups events throught CartoDB. I have seen that some events are working like 'click', 'movestart',but 'popupclose' and 'popupopen' are not working. My goal is to do some ...
0
votes
1answer
38 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
60 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
42 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
1answer
386 views

Creating Leaflet layer that can be toggled in layer control from CartoDB viz.json?

How do I create a leaflet layer that can be toggled in the layer control from a cartodb viz.json? I have read that the cartodb.createlayer does not create a leaflet layer. It seems you can add the ...
0
votes
1answer
33 views

Hide/Show leaflet markers based on specific values

So 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') ...
0
votes
2answers
44 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
39 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
32 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
36 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
1k views

Bootstrap navbar and leaflet zoom controls

I'm using the THE MAP GUY(DE) Bootstrap temple and applying it to leaflet using the code below. The issue I'm having is that the zoom-control doesn't toggle right on page load. It will only after ...
1
vote
1answer
41 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", ...
0
votes
1answer
214 views

Convert Leaflet WMS layer to Leaflet GeoJSON layer

Using the Leaflet API I am adding a WMS layer through the L.tilelayer.WMS feature. This feature includes only a certain amount of options such as 'layers','crs','style' etc. Through the Leaflet ...
0
votes
3answers
456 views

How to load geojson from geoserver to define a variable in leaflet?

How can I load a geojson file from geoserver in leafletjs? There are lot of suggestions out there, but none of them work for me. Currently my app loads a js file from the server that starts like ...
2
votes
1answer
51 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 ...
0
votes
1answer
215 views

How to call a leaflet Javascript Function in dropdown menu bar?

i have the following problem: my target is a hybrid app with leaflet. I create a dropdown menu with html/CSS/JQuery. Here is the code: <nav> <ul> <li id="menuPoint1"><image ...
0
votes
1answer
232 views

serving UTFgrid information made with mb-util with leaflet

I've created the mbtiles file with tilemill and exported it on my ubuntu webfolder with the following command: mb-util --scheme=xyz /folder/tile.mbtiles /var/www/html/my-tiles To get utfgrid ...
1
vote
1answer
79 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
74 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
93 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
33 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
21 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
24 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
29 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 = ...
2
votes
1answer
36 views

Displaying colored traces and waypoints

Goal: display map with few routes, which have colored segments. Also displays few waypoints with text + gives option to download few gpx routes and additional text. I see that gpx format has ...
1
vote
1answer
39 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
41 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 ...
2
votes
2answers
648 views

How to calculate the bounding box of a geojson object using python or javascript?

I have django app with leaflet on the frontend and I need to calculate the bbox of my geojson so that I can pass the coordinates to map.fitBounds() I have tried some libs as well as trying the ...
1
vote
3answers
191 views

Load a really big geojson to a feature layer in leaflet

I have this geojson file(about 60mB) that contains the administrative area boundaries. I want to make a chloropleth and give color based on each geometry properties value and add it to the ...
0
votes
0answers
35 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
2answers
40 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 ...
0
votes
1answer
16 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
2answers
29 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
1answer
19 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
20 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 ...
15
votes
6answers
15k views

How to Create Animated Cluster Markers in OpenLayers/Leaflet?

I want to use Leaflet due to the smooth transitions which Openlayers seems like they can't match. I specifically require the ability to cluster markers with custom styled marker groups. The best ...
0
votes
1answer
31 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 ...