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

learn more… | top users | synonyms (1)

3
votes
3answers
3k views

Sizing Leaflet Map inside bootstrap

I have been trying to change the height of my leaflet map to a percentage inside of bootstrap but everytime I do the map will not draw. Thus, I always have to revert to px value. I'm pretty sure its a ...
1
vote
3answers
225 views

Bootstrap and Leaflet - Grid Issue

Trying to use integrate a simple leaflet map within Bootstrap grid / column. While I am trying to follow tutorials and templates, for some reason the <div> id="map"</div>does not seem to ...
2
votes
1answer
651 views

How to keep bound popups from opening on [click]?

I am working on a map application which creates and binds popups on markers and polyline objects. The popups are created and bound lazily, i.e. ad-hoc when a user clicks on a specific object. The ...
2
votes
1answer
56 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
86 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 ...
3
votes
1answer
99 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', ...
1
vote
1answer
75 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 ...
1
vote
2answers
2k views

How to deal Leaflet map control checkboxes?

I add some geojson layers to the map control once a layer is loaded and the control can show all the layer names. But I notice that all the checkboxes are unchecked by default. So that once I click ...
2
votes
1answer
48 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". ...
0
votes
1answer
478 views

PHP-MBTiles Server implementation with Leaflet and Wax

Using PHP tile server from infostreams with Leaflet and Wax Connector for Leaflet to visualize my .mbtiles. I upped the source and the .mbtiles on a free hosting service. I am getting a blank Leaflet ...
5
votes
0answers
139 views

How to add an attribution on a GeoJSON Layer from Leaflet?

I need to use a GeoJSON Layer on my Leaflet map. Here is a sample of my code: function onEachFeature(feature, layer) { if (feature.properties && feature.properties.popupContent) { ...
1
vote
1answer
42 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 ...
1
vote
1answer
62 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 ...
1
vote
1answer
45 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
67 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
3answers
1k views

gdal2tiles.py generates wrong tiles / MapTiler the right ones

I'm trying to generate tiles with gdal2tiles.py and the resulting tiles are stored as 18/132639/164219. If I do the same thing with MapTiler (the GUI variant of gdal2tiles) the tile result is ...
1
vote
2answers
159 views

I've installed OpenGeo Suite, how do I use it with Leaflet?

I've just finished installing OpenGeo Suite on my VM Ubuntu web server. I'd like to be able to use Leaflet from leafletjs.com to view my maps with on my mobile devices. I'm supposed to create an ...
1
vote
1answer
204 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
votes
1answer
132 views

Leaflet Javascript: Layer Control Style in Internet Explorer Messed Up

[Update: Never mind. Got it. Will post the answer later. Thx] Please see this link: http://gisdev.clemson.edu/ffliestemp/ . Only in Internet Explorer the Layer's Control box/panel is expanded all ...
2
votes
1answer
59 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
0
votes
1answer
151 views

CartoDB or Leaflet.js get coordinates of point clicked?

Using CartoDB or Leaflet.js is it possible to retrieve the coordinates of the point on the map clicked when opening an infowindow?
2
votes
1answer
84 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 ...
2
votes
2answers
562 views

Leaflet.geojson webpage performance out of hand, how to convert to .png?

I exported some countries as a single .geojson file. The file includes every country's vertices and coordinates, as that's what a .geojson is ─ a vector file. Thing is, there are about 20 countries ...
4
votes
2answers
70 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: ...
0
votes
0answers
26 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
95 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 ...
2
votes
1answer
81 views

Most efficient way to use UTM in leaflet

Our server is using UTM internally. We then send a large number of UTM Coordinates to display them in a custom made leaflet layer. First we transform (unproject) them into "normal" geographical ...
2
votes
2answers
987 views

UTM Grid as a Layer with Leaflet

How can I display a UTM Grid as a layer with Leaflet? Search a way to embed a OpenStreetMap map with Leaflet in a website. Particularity. I want to display a UTM Grid as a Layer. In addition, lower ...
1
vote
1answer
42 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 ...
2
votes
0answers
34 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 ...
3
votes
2answers
190 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
39 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 ...
1
vote
0answers
62 views

Adding marker on a leaflet map

I'm very new to GIS and for learning I started with building a simple web app with GeoDjango. I am using dango-leaflet. Since I have a very limited knowledge I am facing many challenges. I'm trying to ...
1
vote
2answers
2k views

how does one reset map.fitbounds (zoomtofeature()) to the original zoom?

I have a lovely map setup using Leaflet with MapBox tiles (only). It is a United States map with polygons for each state with an onclick event to zoomToFeature. The basic zoomToFeature() function ...
0
votes
1answer
43 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 ...
1
vote
1answer
77 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
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. ...
0
votes
0answers
157 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
37 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 ...
3
votes
4answers
1k views

Display GeoJSON layer on top a SVG image instead of a map.

I'm very new to GIS, so hope this is the correct place to ask. Not sure if this will even be possible. This is what I want to achieve: In short, I want to display a set of polygons, lines etc. in a ...
10
votes
4answers
11k views

How to show a popup on mouse-over, not on click?

Is it possible in Leaflet that popup opens on mouse-over, not on click? This is working for just one marker at a time, but I need it for a bigger number of markers: marker.on('mouseover', ...
0
votes
0answers
32 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
84 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
36 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 ...
2
votes
1answer
191 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, { ...
0
votes
1answer
52 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. ...
5
votes
1answer
107 views

Need Advice - Displaying very large amounts of data on Leaflet js from database

I'm researching the best way to display a very large weather dataset (850mb +/-) for folks to use on their mobile and desktop devices. This huge dataset (1 point every 12km across the USA) that I'd ...
1
vote
1answer
132 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 ...
0
votes
0answers
210 views

How to create dynamic legend for multiply layers with leaflet.js?

I want to create multiple choropleth maps which displays different statistical data with leaflet.js. So it would be nice to show different legends for each map. I create such legends for two layers ...
1
vote
1answer
55 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 ...