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

learn more… | top users | synonyms

2
votes
2answers
70 views

How to generate legend in leaflet webmap?

Although I have checked the "Create Legend" option in the qgis2leaf plugin, it did not generate any legend in the output webmap. What am I missing here ?
1
vote
1answer
128 views

Custom marker/icon based on attribute data in leaflet/geojson

I would like to add different icons to my leaflet map based on attribute data. My layer is a geojson layer, it is coming from geoserver with jsnop. I can see my data with the default marker, but when ...
0
votes
0answers
29 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: ~~~ ...
5
votes
0answers
78 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) { ...
2
votes
1answer
71 views

Using OSM Buildings in Leaflet: how to deactivate layer on loading map

I'm trying to use OSMBuildings in my Leaflet map. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>OSM Buildings Test</title> <link ...
0
votes
0answers
57 views

How to query postgres with gis to get GeoJSON for GeoJSON tile layer?

I have a postgres database with one table like the following: CREATE TABLE post_pl ( gid serial NOT NULL, zip character varying(5), zip_n integer, city character varying(50), geom ...
1
vote
1answer
52 views

hiding some “feature”s in GeoJSON file on map

I have geojson file including boundaries of most countries in world. When I clicked on a "feature" (aka country, or polygon) I want to hide it while keep showing the others. because I am planing to ...
0
votes
0answers
27 views

Unable to identify the colours on leaflet

var non_tfl_lines_JubileetoIlford = L.geoJson(non_tfl_lines_JubileetoIlford, { pointToLayer: function(feature, latlng) { switch (feature.geometry.type) { case 'LineString': return new ...
0
votes
0answers
41 views

Run-time substitution on MapServer with Leaflet

I have a MapServer instance and map file displaying data in selected countries using a Leaflet WMS tileLayer. This map file works to display points from a single country (showing the LAYER definition ...
2
votes
1answer
99 views

leaflet marker-cluster JSONP geoserver

I hope I can get same help from here. I started to put together a leaflet map, please see here: http://gis.xyz/leaflet2.html I want to show my postgis point (uk based) features on this map with ...
2
votes
1answer
70 views

openlayers leaflet and popup

I am working on a map mixing openlayers and leaflet librairies (it is possible, correct ?). I am such a beginner that, after lots of readings, I thought creating popups was less difficult for me ...
1
vote
3answers
108 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 ...
1
vote
1answer
85 views

Adding popup to geojson layer based on feature property?

I'm using leaflet and trying to add a popup to a point on the map that will return a property of the point from the geojson file. Going off this post has been helpful problem adding pop-up to GeoJSON ...
2
votes
1answer
36 views

Distort image to display on leaflet.js based on known 16x16 point grid

I have an image that is a satellite picture, and with php gd I want to distort it so I can overlay it on a leaflet.js map. To make it a bit more simple, I have a grid of points, 16x16 which bind the ...
1
vote
1answer
81 views

Leaflet HTTP.Get bad request; not loading tiles

I am trying to walk through the Leaflet quick start tutorial and am having a really simple issue: None of my tiles are loading. I get this error at the image url and an HTTP Bad Request in the ...
4
votes
1answer
131 views

*Leaflet* mouse wheel zoom only after click on map

I'm working with the Leaflet JavaScript Library and attached a (working) map to my HTML Document. It is in the middle of the page, and when I'm scrolling down with my mouse wheel and arrive at the ...
3
votes
1answer
53 views

Zoom in to see details

I have 2 shape files, one that shows all the counties on an island, the other shows all the villages on the island. Here is the scenario: My initial map shows the counties. When you click on a ...
1
vote
1answer
79 views

Moving from OpenLayers to Leaflet breaks tilecache

My tilecache.cfg is like so (working with MapServer) [mylayer] type=WMS url=http://server/mapserver/app spherical_mercator=true layers=mylayer The following works just fine var mylayer = new ...
1
vote
1answer
46 views

Leaflet Draw - add title to marker or shape?

I am trying to create a participatory mapping site where users can draw pts, lines and polys using Leaflet draw. Is it possible to create a pop window where users can add a title or description of ...
2
votes
1answer
55 views

Display a link in a popup with Leaflet

Hey there! Im working with the Leaflet javascript library. There should be an option to click on my map and view a popup. I already have a code for that: var popup = L.popup(); function ...
0
votes
0answers
16 views

GeoJSON of half the earth [duplicate]

I'm currently trying to model daytime/nighttime in leaflet, and the only way I currently see me being able to do that is to have a GeoJSON polygon reflecting half of the earth (for daytime/nighttime ...
0
votes
1answer
61 views

Displaying geojson data in leaflet

I am trying to access and display some data in a geojson layer and would appreciate if someone can take a look at my code below and suggest what I need to do to make it work. The result of the ...
1
vote
1answer
46 views

Is there a way to have a choropleth map in Excel reading data from a sheet?

Is it possible to have a solution similar to ESRI maps for office in which I want basically a geojson file or any file for that matters to render a choropleth map based on data in a sheet? Tried ...
0
votes
1answer
65 views

Displaying click results in a side panel

I am trying to do something similar to the interactive choropleth map (http://leafletjs.com/examples/choropleth.html) on leaflet's website. In my case I want to use a click instead of a hover and ...
2
votes
0answers
27 views

What is the best way to handle metadata with TileStache?

When I'm serving up maps and UtfGrids with tileStache I would like to also include some metadata with the layers so that my leaflet application can understand the context of the layer. For example: ...
2
votes
1answer
57 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 ...
0
votes
0answers
26 views

Leaflet.js - drag marker from popup

I am trying to allow markers to be dragged via their popup. On mobile devices the marker position to is hard to see underneath the user's finger. If an area on the popup can be designated as an anchor ...
1
vote
2answers
150 views

How to style geojson polygon using L.mapbox.featureLayer()

I have this code: var SupIncend = L.mapbox.featureLayer().addTo(map); var ArbolesAntes = L.mapbox.featureLayer().addTo(map); var ArbolesX = L.mapbox.featureLayer().addTo(map); var ...
1
vote
1answer
34 views

How to insert a map into another map?

If you look at this site it has a main map window but it also has a small window map at the top right corner. What is the technical term for the smaller window? How is that window created? I am ...
5
votes
1answer
83 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 ...
0
votes
0answers
24 views

MySQL Select rows where line strings are within a bounding box

I have a MySQL DB with some spatial data stored in a table after being input via ogr2ogr from a shapefile. The structure is similar to the following: OGR_FID int SHAPE geometry (all line ...
0
votes
0answers
10 views

How to set up proxy for Geoserver GetFeatureInfo call? [duplicate]

I have problems with cross domain, I call GetFeatureInfo in Leaflet API. I was looking for solution and saw that proxy could solve that problem. Can you help me how to set it up? I have geoserver run ...
4
votes
2answers
87 views

Plot a Raster of Weather data in Leaflet JavaScript Map without generating server-side tiles?

I want to show different weather data I have as binary arrays on a server using leaflet. But I do not want to generate tiles on the server. For each point in an a array I have the coordinates in ...
1
vote
0answers
110 views

Passing ng-directive to Leaflet L.popup().setContent() [closed]

Goal: Pass an Angular directive to the .setContent() method of L.popup() The Problem: I need to run $compile on the directive in order for it to enter ng. But something like: ...
1
vote
0answers
55 views

Multiple Leaflet maps on website in different divs

I'm pretty new to leaflet.js and I'm trying to figure out how to assign the same map with the same set of options and layers to a different HTML container instead of having to remove and add a new one ...
2
votes
0answers
34 views

Stray horizontal lines after converting from GeoJSON to topojson

After converting a GeoJSON file to topojson, and loading the topojson into Leaflet, stray lines appear in the resulting map. Like this: What is causing this? If I view the GeoJSON, these stray ...
4
votes
1answer
65 views

Leaflet: how to change default style on a point GeoJSON Layer?

I need to change style on a point GeoJSON layer in a Leaflet map. I'm using the following code: function onEachFeature(feature, layer) { if (feature.properties && ...
0
votes
0answers
19 views

Leaflet: verify when a layer is checked in control layers

I'm a newbie in Leaflet, so sorry for the entry level question .... Is there any way to test if a layer in Control Layers is checked or not? I don't find any in API documentation.
1
vote
0answers
65 views

How to get the total route km route using machine leaflet

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 http://www.liedman.net/leaflet-routing-machine/api/#iroutesummary ...
1
vote
0answers
31 views

Geocoder leaflet for internal use in the company, which take addresses from any part of the street

I am making a personal application routing to be used internally in the company using machine leaflet route. The plugin uses nominatim geocoder, but he geocodificia according to the links of the OSM. ...
0
votes
1answer
104 views

Error with Leaflet Routing Machine

I downloaded the Leaflet Routing Machine from https://github.com/perliedman/leaflet-routing-machine. Unzipped and opened the index.html in my browser to see how it looks, and got an error as shown in ...
1
vote
0answers
47 views

What is wrong with my data receiving from php script for geoJSON TileLayer?

I want to get geo data as geojson for geojson tile layer requests in leaflet. I set up a geojson layer like this: https://github.com/glenrobertson/leaflet-tilelayer-geojson/ A php script answers ...
1
vote
0answers
24 views

Leaflet: Is there a way to use click event just like mouseout?

I made a map with leaflet by following the official Leaflet tutorial on interactive choropleth maps. I would like to make the map compatible with smartphones, so I added a click event, which acts ...
1
vote
1answer
74 views

Query and Visualize GeoJSON data [closed]

I am trying to visualize specific GeoJSON data. I am successfully loading the full GeoJSON file (Multipolygon) using Leaflet JS. Is there any query to find specific polygon from that GeoJSON file? ...
2
votes
1answer
78 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', ...
1
vote
0answers
43 views

Show large information in a map (millions of points)

I have millions of points (census data) about 1.5Gb in a text file. But I only want to show an area based on this points like a heat map, so maybe I have to build polygons based on these points. What ...
2
votes
0answers
46 views

Popups not showing on layer/feature/marker groups

I had two problems. One was that, once I got lots of markers in one layer, and lots of polylines in another, someof my markers, starting from the north, started to vanish. I noted in the doco that ...
1
vote
1answer
214 views

How to use Leaflet Marker Cluster on markers from Leaflet-layerJSON (Overpass API)

I'm having troubles getting the Leaflet Marker Cluster working with Leaflet-layerJSON. I'm trying to make a Leaflet map with data from OpenStreetMap. The markers are showing on the map, but they are ...
2
votes
0answers
43 views

loading geojson in leaflet

I just added the geoJSON vector layer in leaflet for my hybrid mobile app using phonegap, the problem is that when I add the geoJSON file of size larger than 2mb the application crashes. What is the ...
1
vote
1answer
86 views

Leaflet WMS GetFeatureInfo gives result only on zoom level 10

I am using GetFeatureInfo with wms layer to get the data behind. The request returns data only after zoom level 10 before that it returns empty features. Does anyone having same issue? I think it ...