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

learn more… | top users | synonyms (1)

0
votes
1answer
256 views

Reset Leaflet map

I'm creating a map like this: var map_object = new L.Map('map', { center: [39.8282, -98.5795], zoom: 5, }); var sublayers = []; ...
0
votes
0answers
11 views

Gis2web - QGIS plugin troubles

I have QGIS 2.6.1 and when I want to get some results using gis2web (by Tom Chadwin) plugin, in fact, to get a webmap in OpenLayers, it seems that plugin doesn't work properly. E.g. I have a point ...
2
votes
1answer
84 views

Custom HTML Within Leaflet Map

We're upgrading our Leaflet maps to be larger on the screen and doing so in part by putting information panels, etc. over the map with varying transparencies. Obviously this is easy to do by ...
1
vote
1answer
184 views

how to draw a polygon in leaflet and add it to geojson file

I am working on a small project with leaflet. the goal of the project is to show a geojson file and updating it dynamicaly from the window of the web site. I have imported the geojson file to the map. ...
0
votes
3answers
42 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
15 views

redraw canvas when add new overlay?

Good day! A little problem: how to redraw canvas when I add overlay layer? Firstly load osm map, then creates canvas. So when I push the botton and add another layer it looks like sandwich and canvas ...
1
vote
1answer
31 views

Leaflet map isn't loading in the correct location

I'm currently working with Leaflet and a dockable web framework called Golden Layout. I'm trying to load tiles into the map, but they are not loading properly and I'm not sure why. Currently, I have ...
2
votes
1answer
536 views

How to get data from TileMill tileLayer properties in Mapbox for click/hover

I've successfully used Leaflet to load a geoJSON polygon-shapefile with data, and added click and hover interactivity to the layer. For a large dataset, I switched to mapbox.js 1.6.1, used TileMill to ...
3
votes
3answers
1k views

'Home' button leaflet map

is there a possibility to have a kind of home button on my map which will zoom to my initial map view or a specific defined position, resp.? Any help welcome! Thanks
1
vote
0answers
28 views

dynamic legend for tiles in Leaflet

Good day dear professionals! I have a little problem. I started to learn javascript and leaflet not so much time ago, and now I can work with layers, but creating controls that I need is to hard for ...
0
votes
1answer
48 views

Have to click twice to open popup leaflet

I am trying to make a map in which a marker can be clicked and a popup opens up with some information. I have successfully done all of that however my first click on any of the markers result in the ...
0
votes
0answers
10 views

How to show busy icon when leaflet api load tile images RSS

i like to know is there any way exist in leaflet api which i can fire when it load tile and when tile loading finish then another function will be called. i was reading leaflet api and found in this ...
1
vote
1answer
19 views

Leaflet js : text is not showing on map

here is my jsfiddle link http://jsfiddle.net/tridip/5abu963o/. i made provision so a yellow color text should be lying on map but not working. here is the js part only i like to highlight. $( ...
2
votes
1answer
135 views

How could I generate a CRS field inside the GeoJSON object created by Leaflet layer.toGeoJSON?

I'm using Leaflet to transform some drawn polygons to GeoJSON and send them to a backend. But the GeoJSON objects generated by layer.toGeoJSON are like this: { "type":"Feature", "properties":{}, ...
0
votes
1answer
189 views

Leaflet.js map - Pan too and Zoom in on point

This is the first time I am using Leaflet.js. I am trying to create a story map but have come across an issue. Currently I have a map with a scrolling text bar on the left hand side. I would like ...
1
vote
2answers
355 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
395 views

How to add multiple cartodb layers in viz.json to a leaflet layer control

I have create a visualisation in cartodb with 4 layers. The resulting viz.json is added to a leaflet map as follows: cartodb.createLayer(cartomap, [url], {https:true}) ...
0
votes
1answer
33 views

Getting GeoJSON formatted properly for Leaflet?

I am trying to get data put on a leaflet map that I have set up. I am following this tutorial: https://www.youtube.com/watch?v=fDfkjx-VhLI I have all of the html, css and js scripts up and running, ...
0
votes
1answer
200 views

Leaflet: how can I update content of popup by jQuery

in my popup is a spinner with class=spinner and an empty container for addon informations. I want to hide after successful ajax. I want to add some html in a container. I tried this: ~~~ ...
2
votes
0answers
42 views

GTA V coordinates to LatLng

I'm here because I'm trying to create a GTA V map with Leafletjs API. In deed, I've got my tiles that are ready. But the aim is to put markers on the map by using GTA V in-game coordinates. To achieve ...
4
votes
2answers
76 views

Big data sets and challenges using the Leaflet client

I am using Leaflet to present around 90.000 data points. My test code is generated using the plugin QGIS2leaf in QGIS 10.10.1. I am using clustering and reviewing the code I can see that this is ...
6
votes
1answer
254 views

Moving a shape around the earth while maintaining the proper projection

What is the transformation needed to be taken on every data point of a shape to rotate that shape around the globe. I'm trying to figure out the math behind this kind of transformation so I can ...
7
votes
2answers
5k views

Auto zoom on multipolygon with leaflet

I have a geojson with a multipolygon and I want to fit this multipolygon to the map. The map center only on one polygon not on the multipolygon. Here is my script var map = L.map('map',{ ...
1
vote
1answer
832 views

How do I add elevation data to a GeoJSON line from a GPX file?

I understand that elevation can be added as an optional third value in Coordinates (lat, long, elev) in a geojson file, but I can't find a way to actually do that from a gpx file. I've used ogr2ogr to ...
1
vote
2answers
46 views

How do I toggle (add/remove) shapefile layers in Leaflet.js?

If I create a shapefile layer var ac_shpfile = new L.Shapefile("data/AC.zip", {onEachFeature: function (feature, layer) { /* Add some colors based on shapefile features */ }}); and then add it to ...
3
votes
1answer
226 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
0answers
39 views

Rendering OpenStreetMaps with GeoServer

My target is to have the whole planet to be available in the map client[leaflet.js/openlayers.js] but only a specific country loaded with roads etc. I have followed the steps below to setup my ...
6
votes
3answers
17k views

How to draw a polyline in Leaflet?

This is my coding I used in Leaflet: var pointA = new L.LatLng(28.635308, 77.22496); var pointB = new L.LatLng(28.984461, 77.70641); var pointList = [pointA, pointB]; var ...
0
votes
0answers
38 views

Click event on anchor tag does not update Leaflet map as expected

I'm having problems updating a Leaflet map from a click event on an anchor tag located within a Leaflet Control on the map. Chrome and Firefox on Mac seem to have identical problems, Safari is ...
0
votes
1answer
30 views

What causes the Leaflet JS Providers error; Uncaught Error: No value provided for variable {time}

I am using leaflet providers and attempting to add the NASAGIBS.ViirsEarthAtNight2012 to my layer control, my other basemaps load fine; but this one doesn't and returns the following errors in the ...
0
votes
0answers
33 views

Problem visualizing OSM's ways twice in leaflet

I have retrieving all types of data from a small B-box using the Overpass Api and i have populated Postgres(postGis) using "osm2pgsql" with the default style. I can extract the ways into geoJson ...
1
vote
1answer
332 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 ...
0
votes
1answer
30 views

Controlling map details shown using Leaflet and MapBox

I am building a map based chart using Leaflet (with MapBox). I would like to know if there is a way to control the level of details displayed on the map when zooming in. For example I do not want to ...
2
votes
1answer
253 views

Is it possible to use two layer.bindPopup functions in Leaflet

I have two different layers in a leaflet map. I have one layer in which I would like the popup to return some text from the layer's attributes. They other layer I would like the popup to return an ...
0
votes
1answer
164 views

LeafletJS Measurement of distance in deepzoom tilelayer

I have been trying to understand how LeafletJS determines distances between two points in a layer. I am trying to implement the custom scale plugin, (and have done so successfully) on a static tiled ...
0
votes
1answer
31 views

Using Leaflet: How do I get it to display one popup based on a condition?

Using Leaflet: How do I get it to display one popup based on a condition. See below. basemap_0.addTo(map); var layerOrder=new Array(); function pop_thunder(feature, layer) { ...
1
vote
1answer
278 views

How do I use Proj4Leaflet projections correctly?

I'm loading data layers from a WMS server into a Leaflet map, and I need to give the user a choice of projections. For the WMS server requests, I just need to change the CRS parameter to a different ...
1
vote
1answer
303 views

Adding comments using leaflet draw

I am working on an application that will leverage the leaflet draw plugin so that a user can open my map and drop comments in the form of markers. Then the user can click submit and it will serve me ...
1
vote
1answer
56 views

Leaflet map.locate, very long response time

I'm using leafletknn to search the nearest geojson element from the user location. I add a map.locate method that zoom to the user location. The response time is longer than when I directly use it... ...
1
vote
0answers
17 views

Leaflet Markercluster and Timeline in sync

So I have been trying to figure how to use the markercluster and timeline plug in in sync to show a temporal animation of points. As some of the point data overlaps a cluster is needed to be able to ...
1
vote
2answers
84 views

How to create a map using LeafLet

Im looking to create a map that can be interactive. The best option that I found is leaflet, the thing is I don't find any resource explaining how to create my own map. Im looking to create an ...
0
votes
1answer
29 views

Dynamic Layer Name - Leaflet Layer Control

I would like to have the name of a layer used by Leaflets layer control feature come from a variable instead of a string and based on data from the layer. The example shown below uses the variable ...
1
vote
1answer
168 views

Leaflet SVG layer is obscuring the underlying GeoJSON interactivity

I have SVG on top of GeoJSON in my map. How can a leaflet SVG overlay be placed outside of the leaflet-overlay-pane while keeping GeoJSON in-place within the leaflet-overlay-pane? (For example, how ...
1
vote
1answer
32 views

R filter shapefiles with dplyr

How to filter shapefiles data in R with dplyr and then put it in a leaflet map? not reproducible example sorry: library(dplyr) library(leaflet) library(sp) library(maptools) library(rgdal) ...
2
votes
1answer
363 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 ...
1
vote
1answer
25 views

How to Convert Just a Sulawesi Map to Leaflet

I'm still develop a Web GIS that show population distribution in form of heat map. I'm use Quantum GIS with Open Street Map & Q2Leaflet Plugin as a tool to accomplish it. The problem is, I just ...
3
votes
2answers
443 views

leaflet geojson contextmenu

I want to add a context menu on right click for various elements on my geojson layer (I'm doing a road map so on a right click on the road at any part I want to show the context menu). I've managed ...
1
vote
2answers
56 views

Leaflet map on click ignore layers

Leaflet has a 'click' event: map.on('click', function(e) { alert(e.latlng); }); This does not appear to work when map layers are displayed on the area clicked. Is there a way to use ...
11
votes
1answer
278 views

How to copy the color styling to a color column in a layer's attribute table?

I have a polygon layer in QGIS that I have applied a random color style to each polygon. Under Layer Properties -> Style I selected a Categorized style and then generated a random color ramp. I added ...
9
votes
3answers
7k views

How to get Leaflet interactivity from Geoserver WMS?

I have geoserver serving shapefiles as a WMS into Leaflet. I'd like to add interativity that shows a popup with WMS attributes in the Leaflet map when the user hovers over or clicks on a WMS feature. ...