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

learn more… | top users | synonyms

1
vote
0answers
18 views

TypeError: L.Proj is undefined in leaflet

I am using leaflet 0.7.3. I am trying to load a wms tile: var crs = new L.Proj.CRS('EPSG:2236', '+proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999941177 +x_0=200000.0001016002 +y_0=0 ...
1
vote
1answer
134 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 ...
1
vote
1answer
90 views

Leaflet and census block data: not displaying

I am new to leaflet and am trying to load a geojson file showing census blocks and associated information for a city in CA. It is a small city and not too many census blocks. I cannot get the popup ...
1
vote
1answer
59 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 ...
2
votes
1answer
244 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
1answer
207 views

TypeError in leaflet on zoom in or out

I am working on an application that renders land parcels from PostGIS as polygons in Leaflet. I have an event handler set for 'viewreset' on the map: this.leaflet_map.on('viewreset', ...
2
votes
1answer
842 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 ...
0
votes
0answers
25 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
1answer
4k views

How to change Leaflet Map panes layering order (z-index)?

Leaflet maintains that the Map panes elements contain all layers added to the map. The difference between many of the Map panes is strictly the z-index order of layering. I would like to use a ...
5
votes
0answers
60 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 && ...
2
votes
0answers
59 views

How to draw ploygon in leaflet that use event?

Is there only one way to draw a polygon through the Leaflet.draw plugin? If you want draw anything, you must add the control ("map.addControl(drawControl);"). I want to draw a polygon on leaflet map ...
2
votes
1answer
54 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
39 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 ...
2
votes
1answer
122 views

How does one use leaflet layergroups with CartoDB layers?

I'm trying to use leaflet layergroups with a cartodb layer, ala: http://leafletjs.com/reference.html#layergroup but haven't been able to successfully do it. This is what I have so far: var map = ...
1
vote
2answers
1k views

How to project pixel coordinates in leaflet?

I am trying to create a map based on an image which is 16384x16384 px, but I would also like to add markers at specific locations using pixel coordinates of this given image. I created a tile layer, ...
3
votes
1answer
45 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
37 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 ...
2
votes
1answer
79 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
49 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', ...
6
votes
4answers
189 views

How to use Leaflet to efficiently show parts of a massive dataset?

I keep seeing non-GIS web developers running into this problem, and I'm not sure what the solution is. There is some dataset of thousands of items. We want to show a map to the user, with the ...
2
votes
1answer
557 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 ...
1
vote
2answers
335 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 ...
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 ...
1
vote
3answers
81 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
65 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 ...
0
votes
0answers
30 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
31 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 ...
2
votes
1answer
55 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 ...
0
votes
2answers
880 views

How do I modify features during runtime, in a GeoJSON feature group on Leaflet?

I have added some GeoJSON to my Leaflet powered map as below. (Altered version) var array_of_layers = L.layerGroup([]); var styleholder = []; var belgium_style = {color: "#d3e46f"}; var bosnia_style ...
2
votes
3answers
4k views

How to add text-only labels on Leaflet map with no icon

I'm looking for a way to show text on Leaflet map using markers or anything else without showing any icon. I want to show text only and be able to style and rotate it... Any suggestion? Thanks a lot ...
1
vote
1answer
69 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
104 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 ...
4
votes
3answers
5k 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 ...
4
votes
1answer
1k views

Does Leaflet has option for scale dependent layers?

Is it possible to show layers with Leaflet depending on scaling? For example not show counties until zoom level reaches 10. Thanks.
1
vote
1answer
65 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
39 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 ...
1
vote
1answer
35 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 ...
10
votes
4answers
8k 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', ...
2
votes
1answer
43 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
1answer
44 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 ...
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
57 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
25 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: ...
5
votes
2answers
127 views

Leaflet: How to enable pan & zoom while GeoJSON still rendering?

I've overlaid a huge GeoJSON geometry on top of my Leaflet map, covering about 20 countries' borderlines (about 1,5 million vertices) using "L.geoJson". Each time I zoom in/out, the computer has to ...
0
votes
1answer
416 views

Leaflet error: Uncaught TypeError: Cannot read property '_controlCorners'

I'm trying to implement the Leaflet choropleth example on a map I already built. I've followed the instructions and seen many implementations of the i.control and control hover option on Github but ...
2
votes
0answers
42 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 ...
4
votes
0answers
62 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 ...
4
votes
2answers
68 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 ...
0
votes
0answers
20 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 ...
3
votes
3answers
263 views

Is it possible to check incoming GeoJSON to see if any of the features are identical to existing ones before adding to map?

I am working on a Rails/PostGIS app and doing a typical ajax call to retrieve GeoJSON within the map viewport bounds. Whenever the map is shifted or zoomed all of the markers are removed and then ...