Tagged Questions

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

learn more… | top users | synonyms (1)

1
vote
1answer
11 views

Add custom variables to leaflet polyline

I'm drawing a route on a map with leaflet. I'd like to click on any point in the line and display the speed and time at that point in a popup ($speed[$i]). latlngs = [<?php for ...
1
vote
1answer
10 views

Changing size of cluster based on number of markers in Leaflet clustermarker

I'm currently using Leaflet's markercluster add-on, which is working really nicely for some of my initial maps. However, I'm wondering if there is a way to modify the clusters so that the size of the ...
1
vote
1answer
26 views

Leaflet - GPX - Clustering

I'm using Leaflet maps together with "Plugins by Pavel Shramov", which allows google usage and GPX file use. This bit was easy enough, but trying now to use markerClusterer. I've spent a few hours ...
0
votes
0answers
7 views

How to toggle legends with layers in Mapbox.js?

Map is currently toggling 23 layers using var = overlays. I want the respective layer legends to appear when layer is toggled on, and show legends of all ON layers. var map = L.map('map',{center: ...
1
vote
1answer
26 views

Get all tileLayers from L.map object in Leaflet

What is the best way to access all displayed tileLayers from a L.map object? Traditionally, I have stashed tileLayers in an object that I can access later, like so: var mapLayers = {} if (! ...
0
votes
2answers
20 views

Leafletjs detect click/touch on layer

How do I detect a click on a layer and find out information about the layer that was clicked? Currently I can do the usual binding a popup and adding a click handler on the layer: ...
1
vote
1answer
76 views

Generate territory polygon from sets of points

I'm looking for a simple way to generate contiguous "territories" from sets of points. Say, points A, B and C are in territory 1, and D, E and F are in territory 2, then generate polygons that lie ...
1
vote
0answers
24 views

Legend not removed when layer changed

I made this webpage with JavaScript and CartoDB. The layer selector works like I expected it to but I noticed that the legend are stacking on top of each other and not being removed when the layer is ...
1
vote
1answer
29 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 ...
2
votes
1answer
31 views

How to display UtfGrid info

first off sorry if this question have been asked, I have been looking for an answer for some time now but cant find any solution. I have created a .mbtiles file with Tilemill, extracted the .png and ...
0
votes
1answer
25 views

Leaflet: how to use a custom marker on a geojson layer?

I'm trying to put on a Leaflet map a geojson and all works fine until I use the default blu marker. Now I'd like to use a custom marker (a little .png icon) and I've changed my code in the follow ...
0
votes
1answer
63 views

Leaflet 1.0 release

I was listening Future of Leaflet talk: http://www.confreaks.com/videos/4665-jsgeo2014-future-of-leaflet and I'm really looking forward for 1.0 release. Are there any news on estimated release date?
0
votes
1answer
31 views

How to make polygons clickable in Leaflet.js / folium

I'm trying to create a clickable leaflet.js map using folium and Python. After a previous query - answered here Geopandas/folium map not displaying - I've added the polygons. But I'm getting a ...
0
votes
2answers
43 views

Change marker color based on GeoJSON filter in Leaftlet

This is what I would like to do: Display all features of a GeoJSON file using Leaflet. Provide a text box where a property can be entered, if any of the GeoJSON properties match with what is entered ...
2
votes
1answer
42 views

Loop through a marker cluster using Leafletjs

I have a variable like this var cubbon = new L.MarkerClusterGroup() then i added many markers to this variable. now i like to create a function() and loop through the variable and find out a marker ...
2
votes
1answer
61 views

JSONP working with Leaflet time slider

I would like to integrate the time slider into a JSONP geoserver. Here is the current code I have http://jsfiddle.net/qcwcrwge/26/ and I would like to use the time slider with a layer called ...
1
vote
0answers
15 views

IE8 problem with proj4.js

This problem is in IE8 and not in Firefox. My first problem was that IE8 don't support JSON natively and I get the "JSON is undefined". I solved this by including json2 or json3. Now JSON.parse ...
0
votes
1answer
46 views

leaflet-omnivore style function

Please pardon my ignorance in advance, but is it possible to style a layer(polygon) using the plugin leaflet-omnivore? All of the examples I've encountered are using the MapBox API I have the layer ...
3
votes
1answer
85 views

How to make transparent the background of a WMS layer in Leaflet

I have inserted the following layer from a geoserver in the following Leaflet map : var nexrad = new L.TileLayer.WMS("URL", { layers: 'Wrecks:WrecksGreaterNorthSea', format: 'image/png', ...
2
votes
1answer
35 views

How do you get the nodes of an area in Overpass API in the “right” order?

I use the Overpass API to get the boundary of an OSM relation. I then use the result to display the boundary on a leaflet map. My problem is however, that the nodes are not in the "right order". ...
2
votes
2answers
47 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
28 views

Leaflet/MarkerCluster plugin - how do update the HTML content of a DivIcon?

In Leaflet, I am using the markercluster plugin, in which you can use the DivIcon class to display custom icons for the clusters. You can set your own HTML for these clusters. However, I can't find ...
0
votes
1answer
41 views

Leafletjs Invalid GeoJSON object

I am using the following coming back from a socketio connection: L.geoJson(data.streets, { onEachFeature: map.onEachFeature }); It's throwing the following error: Invalid GeoJSON object. My ...
2
votes
1answer
42 views

find inner bounds of a polygon in leaflet

How can I find the inner bounds of a polygon in leaflet? I a want to plot points randomly in polygoon but when I say Layer.getBounds() I get the bounds and I can still plot the markers ...
2
votes
1answer
49 views

How to get a table from a leaflet map?

I have a map Here based on leaflet JS and the layers are geojson. I would like to get a table at on another div when I click on each layers. How would I be able to do that? Thanks
2
votes
1answer
68 views

Saving Leaflet Maps in Database

I have a webpage with a Leaflet Map, I can add markers,filter markers and so on. My question is that how can I save it? Load the Map Add some Markers on the Map (Optional) Filter the Markers on ...
1
vote
1answer
50 views

Problem with Leafletjs and GeoJSON

I am new to Leafletjs and I am trying to figure out how to plot a polyline on a map using a geoJson object. I've gotten as far as getting a map, making it centered on a given lat/long and setting the ...
0
votes
0answers
23 views

Integrate leaflet module in a google maps application

Is it possible to use a leaflet application over a google maps application? What I want is to integrate a leaflet module / application over a google maps application just by passing the google maps ...
1
vote
1answer
61 views

How can I convert GeoJSON with multiple Polygons and MultiPolygons into single MultiPolygon?

Is this even possible? I have a GeoJSON file with multiple polygons and multipolygons, and I need to set styling on them (in Leaflet.js). I'd like to create a single, large MultiPolygon from the ...
1
vote
1answer
26 views

Load or display differents geojson data on zoom level for leaflet maps

I have a map with 3 levels of information. The first is the country, the second the state and the last one the cities. I wonder know if it's possible to use the zoom value in order to display the ...
4
votes
2answers
61 views

Visualization of a field in Leaflet

In a Leaflet app I want to overlay raster data (technically speaking, a field) on a web map. The data consists of triples < lat,lon,value >, where value is in range [0,1], for example: ...
2
votes
0answers
27 views

Check/uncheck overlays in groupedlayercontrol.js

In a Leaflet-based app I have create several overlays, grouped with leaflet.groupedlayercontrol.js, as shown in this image: Everything works well, but I need to uncheck certain layers, allowing the ...
1
vote
1answer
113 views

How to open overlay content from leaflet popup

Hi! I am currently working on an interactive leaflet map. I managed to display markers from a database via php (create an array). Now I want users to create markers with a click on the map. To add a ...
1
vote
1answer
30 views

Update mouseover information with baselayerchange on leaflet map

On leaflet map I use baselayerchange in order to change the legend box and the info popup on rollover. The legend change works perfectly but I have a problem with the infobox (name info0/info1...), I ...
3
votes
2answers
118 views

Merge geojson polygons with WGS84 coordinate

I have a Geojson file with some adjacent polygons and I want to merge them into one. I know it's a recurrent question but I can't find information for polygons with latitude and longitude coordinates ...
1
vote
1answer
37 views

2 Legends in Leaflet

In Leaflet I want to add a legend when I turn on an overlay, then when I turn off that overlay I want the legend to disappear and when I turn on a second overlay I want a second legend to appear. I ...
0
votes
1answer
39 views

Leaflet & Esri-Leaflet: JSON objects not drawing correctly when using 'fields' filter

I am working with Leaflet 0.7.3 and esri-leaflet beta.6. Using L.esri.Layers.FeatureLayer works fine until I add the fields filter. At that point, the geojson objects draw sporadically (mostly not at ...
0
votes
0answers
10 views

Restrict legend to map bounds in CartoDB.js

Does anyone know how to restrict legend content based on map bounds in CartoDB.js? I am building a large, complicated legend and I would like it to only display visible features to reduce complexity. ...
1
vote
1answer
53 views

Leaflet - how do you get individual markers from a featurelayer?

In Leaflet, if I have a feature layer filled with markers, how do I get these markers back from the layer? I want to apply different popups to each individual marker, instead of the entire set. I ...
0
votes
0answers
105 views

Leaflet - very basic, simple routing - OSM & Google Maps

I am using LeafletJS and I need to display the most basic route available, having many waypoints/stops (not enough to draw polylines though). This route is supposed to be for public transport in ...
0
votes
1answer
33 views

Collapsable control in Leaflet

A simple to ask but difficult to answer question: I want to create a control like the one in the Leaflet layers example: http://leafletjs.com/examples/layers-control.html Notice that the control is ...
0
votes
0answers
26 views

Leaflet.EasyButton toggle

I am attempting to incorporate Leaflet.EasyButton into an application. While I am able to drop it in and call a function I would like it to toggle on/off. right now it is loading an inner.HTML div ...
1
vote
2answers
53 views

multiple, simultaneous TileLayers in leaflet?

I would like to have two tile layers in Leaflet, one a conventional set of tiles, and another composed of PNG tiles with transparency, so basically a tiled overlay layer. Is this possible? I see ...
1
vote
1answer
27 views

WFS with EPSG:3301 projection using Leaflet

I am adding WFS points to Leaflet map, but don't see them on the map, however in console I see that all points I wanted is here with all properties and geometries. But the problem here is in ...
0
votes
1answer
32 views

How to style specific polygons from a geojson with Leaflet

I have a World Countries geojson, that has country codes as "ID" (feature.id) and names as feature.properties.name I would like to color specific countries for making a "countries visited" map. ...
1
vote
1answer
45 views

How to let leaflet layer events to propagate to layer below

I am working on a leaflet map with three layers: a base tile-layer, a GeoJson layer and a label tile-layer. For display, I want the label layer to be on top, but for interaction I would like to let ...
1
vote
1answer
44 views

Problem showing WMS with EPSG:3301 projection using Leaflet

I am trying to show wms layer EPSG:3301 using leaflet, but have no succes for a long time. http://kaart.maaamet.ee/wms/alus?service=WMS&version=1.3.0&request=GetCapabilities Here is my code: ...
2
votes
1answer
128 views

GeoJSON, circlemarkers using the Leaflet OverlappingMarkerSpiderfier plugin

I am wondering if I can use the Leaflet OverlappingMarkerSpiderfier plugin with my circlemarkers. I've loaded a GeoJSON file and added circlemarkers using; var gj = L.geoJson(route, { ...
1
vote
1answer
66 views

Custom ordering/z-index of icons in Leaflet layer

I have a single layer (points) with a bunch of markers. Each point has an attribute that is regularly updated. I understand by Leaflet sorts the layers such that those lower in latitude are on top for ...
1
vote
1answer
34 views

adding bing (with labels) maps to leaflet

I am using this leaflet plugin to render bing aerial map as a base layer onto a leaflet map. baseMapUrl = new L.BingLayer(bing_key); map.addLayer(baseMapUrl); But I am unable to find a way to ...