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

learn more… | top users | synonyms (1)

1
vote
1answer
246 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 ...
0
votes
1answer
253 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
44 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
10 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
58 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
13 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
162 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 ...
0
votes
1answer
21 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
300 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
18 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
436 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
38 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
265 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. ...
1
vote
1answer
160 views

Leaflet Draw - Get Circle extent

I am using Leaflet.Draw to draw a circle. var circle = L.circle(new L.LatLng(latitude, longitude), number, circle_options).addTo(featureGroup); I need the coordinates of the circle as a polygon ...
0
votes
1answer
427 views

Leaflet geoserver wms doesn't show on google map base layer

I have a site running Openlayers (base layer google and overlay wms in epsg4326 from geoserver). The site works fine. I've decided to try doing the same with leaflet , and from some reason I can't ...
0
votes
2answers
293 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: ...
2
votes
1answer
776 views

How to get the total km of route using Leaflet Routing Machine API?

I'm using machine leaflet route to draw routes I can get the total route miles? How can I do this? I know the class IRouteSummary, but I am unable to access it. Just wanted an example so that I can ...
2
votes
2answers
26 views

CartoDB latlon change to lonlat

I have this script I am trying to use to search for a value within a CartoDB table. I can't seem to figure out how to reverse the order of the lat & long coordinates so they appear as lonlat... ...
1
vote
2answers
467 views

Polygon intersection with bounding box with polygon's holes intact

I am trying to serve GeoJSON FeatureCollection tiles with each feature's geometries trimmed to the tile boundary. I am working on a Leaflet plugin to re-assemble the geometries. It works by building ...
1
vote
2answers
115 views

Heatmaps: right terms (isopleth vs choropleth, etc) and how to implement a value-based one that looks good?

NOTE: My original question was about interpolation methods, but I've found that I was actually asking the wrong question. Interpolation methods with Heatmaps and IDW are the least of my problems right ...
0
votes
0answers
19 views

Mapbox.js: Bind dynamic popups with featureLayer?

I am building a multiple chloropleth map using v2.2.1 of Mapbox.js with featureLayer. Now I would like to add tooltips with custom content on hover event. This code is working well to set up the ...
1
vote
0answers
27 views

Geoserver create generic dynamic style

I'm quite new to geoserver, and I wonder if its possible to create a dynamic style. I got a big shapefile with more than 600 variables, and I want to create a generic style where you can input the ...
0
votes
1answer
36 views

How to let the user resize a Leaflet map <div>

I use Leaflet to display some map. I would like the user to be able to resize the map by dragging its borders as she likes. I would like to do this without additional Javascript libraries, instead by ...
4
votes
3answers
828 views

geoserver heatmap tiles doesn't display well (with leaflet)

I am trying to display a heatmap generated with geoserver on my map using the L.tileLayer.WMS class from Leaflet, but the tiles do not fit well together. Do you have any idea how to fix it?
1
vote
2answers
33 views

Leaflet's shapefile plugin only compatible with Firefox

I created a html page (currently locally) and used Leaflet to create a basic map to which i plan to add several shapefiles. To do this, i use the leaflet.shapefile extension ...
0
votes
1answer
181 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 ...
2
votes
1answer
220 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 ...
40
votes
5answers
23k views

Should I use OpenLayers or Leaflet?

I was debating with one of my collegues on OpenLayers v/s Leaflet. I made a point that OpenLayers is much better API if we wish to build a project, where you need direct connectivity to the Geoserver ...
7
votes
1answer
2k views

Generating Interactive Tiles using Nodejs, Mapnik, and PostGIS for Leaflet

I am looking to do something like this but where I have all the data on the same server. I've been following through the set of tutorials @ sparkgeo.com/labs/big/ and I'm having some difficulty. ...
2
votes
1answer
436 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 ...
0
votes
0answers
6 views

How to change Level Zero Tile Count in Leaflet

I have a tile map that I want to display using Leaflet but the base layer is 4 tiles by 4 tiles instead of the usual 2 by 2. Is there a way make this work with Leaflet?
0
votes
1answer
15 views

How to configure Apache for topojson gzip files

Building an online interactive map with leaflet and some heavy layers with my spatial data in topojson format. I have been reading about gzip but I am still uncertain how to configure it. Do I need ...
2
votes
1answer
76 views

Legend not removed when layer changed [closed]

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 ...
8
votes
4answers
11k views

Custom Leaflet Controls

I have gotton some help in creating a custom control for leaflet, but I am still having trouble upgrading to the CSS styles used by the latest versions of Leaflet. Basically, all I need is a icon in ...
0
votes
3answers
88 views

Collapse leaflet control

I want to collapse a leaflet control on my map. I have the current code: var legend = L.control({position: 'bottomright', collapsed:true}); legend.onAdd = function (map) { var div = ...
0
votes
1answer
99 views

Leaflet: Scroll wheel controlling map zoom and not drop down menu

Edited 6/19/2015 I have a custom leaflet control box with a drop down menu. When I use the scroll wheel over the menu, the map changes zoom level instead of scrolling the menu. The problem occurs ...
2
votes
1answer
23 views

disable onEachFeature at zoom level, leaflet

I have a leaflet map that zooms and fits on the bounds of the polygon that is clicked via onEachFeature. Is there a way to disable this at a certain zoom level? I add new layers on the 'zoomend' ...
2
votes
1answer
544 views

Leaflet Map Dropdown

I am attempting to create a simple basemap selector to use in a leaflet map to assist in selecting a basemap of interest. I've created a new Select control that works great in a computer browser but ...
0
votes
1answer
36 views

Image won't center in Leaflet pop-up

I am using Leaflet to create a map of points (from geojson) that will open a picture and text under the picture. The text is centered, but I am having trouble centering the picture. This seems like ...
0
votes
0answers
29 views

Leaflet - Getting tile border coordinates

Displaying grid borders is fairly easy with CSS or adding an image like this: The result is a map like this: However, I'm having a hard time trying to get the coordinates of those tile borders. ...
1
vote
1answer
24 views

leaflet / change a geojson divicon html

I have a geojson layer with a divIcon and now i want to change it. i have tried whit seticon but it does not work. How could i do it? This is what I am trying: papesjson.eachLayer(function(layer){ ...
1
vote
1answer
30 views

Leaflet Routing Machine won't read waypoints from variable TypeError: t is null

I am trying to add waypoints from a variable to a leaflet map. The resulting variable split_route1 is formatted correctly and when I hard-code the waypoints from the console log results, the ...
1
vote
1answer
22 views

WMS layer details not clearly visible in Leaflet

I cannot figure out where the problm is. I use GeoServer and Leaflet. My problem is that when I visualise some layers (in particular that with the names of the clients) I cannot see them all at each ...
1
vote
1answer
461 views

Getting Leaflet and image popup from QGIS export working?

I am a novice in using leaflet, I exported my map layers from QGIS to a working Leaflet map. I am trying to modify the popup to use the attribute so as to get an image popup. i am however stuck as i ...
2
votes
1answer
351 views

Formating GeoJSON file with Leaflet Ajax-plugin

First of all I apologize for my basic english. I have to say, too, that I'm really a newby in coding. I'm trying to create an interactive map using Leaflet (you can see it here). I was able to show my ...
4
votes
2answers
116 views

Batch create Leaflet webmaps in QGIS

During a project on the spider fauna of Greece, we have to face the design of distribution maps of the species. A good tool to work with is the design of Leaflet webmaps to be used on the website ...
0
votes
0answers
21 views

How to load GeoWebCache tiles into Leaflet?

Tiles are already created in GeoWebCache, but they can't be loaded into Leaflet. I can't figure out where I did wrong in the settings of GeoServer. Could anyone point out the possible cause? ...
0
votes
1answer
21 views

Selecting features by attribute in Leaflet

Is there a way to select an individual feature based on an attribute from a FeatureGroup in Leaflet? For example, when selecting a feature based on a click event, I will do something like, function ...
0
votes
1answer
40 views

QGIS2WEB white screen on export/preview?

When I export my QGIS2WEB project it goes through, but when it loads up in my browser after the export is done all I see is a white background with the zoom/minus feature in the top left hand of the ...