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

learn more… | top users | synonyms

3
votes
3answers
9k 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 ...
3
votes
1answer
592 views

How to save a Leaflet or OpenLayers map for opening later?

Can a webmap state be saved to a text file or something for restoring later? Like if I set up a map with a particular zoom and choose my layers and draw a polygon or two, can it be saved to a file and ...
3
votes
2answers
331 views

Disable panning/dragging on leaflet map for div within map

This may be a bit trivial, but does anyone know how to suppress panning when you click and drag over top of a div box embedded within the map itself? Not sure if this question has been asked in ...
3
votes
1answer
2k views

How to highlight features on user click in Leaflet?

I'm new to leaflet & javascript. I made local tiles using maperitive, I can draw Polygons, Polyline & Points using GeoJson over the tiles using leaflet, I can serve the both (tiles & ...
3
votes
2answers
83 views

Mixing coodinate systems

I'm planning to create an online map with openlayers (2 or 3) or leaflet. I have to show some points/markers (~30.000), polygons (~500) and lines in an area of ~10x10 kilometers in several layers. ...
3
votes
1answer
164 views

looking for an esri compatible javascript engine

I work on an esri heavy team, i'm looking for a mapping engine that will give me flexibility to build on top of and leverage only the pieces I need and or add more as the app grows. I've been using ...
3
votes
2answers
2k views

OpenLayers vs Leaflet for specific app

Could anybody give me some advice on which one should I use? OpenLayers or Leaflet I will implement OSM on a web-app for taxi management. The requirements for the map part are: Tracking of the ...
3
votes
1answer
78 views

Day and night zone layer for Leaflet

I'm working with Leaflet and I'd like to show the day and night zones adding a dynamic layer to my map. I was thinking to add a static layer with some transparency and make it move every x minutes but ...
3
votes
1answer
230 views

How to create leaflet legend for points

I have points like this in a leaflet map. The points come originally from a GeoJSON file and I used L.circleMarker to convert them to circles. How can I create a legend for these points? Based on ...
3
votes
2answers
96 views

How to display information in a div outside the map?

I tried a bit around and created a simple map with two polygons(most of the code I got from the Interactive Choropleth Map Tutorial). I added a "L.control()" to show information about the polygons in ...
3
votes
2answers
1k views

Leaflet proj4leaflet with multiple projections

I am looking at having both EPSG4326 tiles and EPSG3857(cloudmade) tiles on a single map (but separate layers). I have been looking at the proj4leaflet plugin, and it "appears" to me that this might ...
3
votes
1answer
347 views

GeoServer 2.3.0 Proxy Setting

I've upgraded to GeoServer 2.3.0 running on Apache Tomcat 7.0.39 on my host WebFaction. My websites and GeoServer are on same host but different ports. How do I go about setting a proxy so that my ...
3
votes
1answer
4k views

How do I get GeoJSON data from GeoServer into show up on my Leaflet map?

I'm trying to create a simple "Green" map for my city. The idea being that it is a website with a map and layers you can turn on and off. I am serving the data through GeoServer and am using GeoJOSN ...
3
votes
1answer
51 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 ...
3
votes
1answer
440 views

Does Leaflet.js uses WebGL for drawing on HTML5 canvas?

If someone could explain how does the Leaflet.js library draws object (and map layers) on HTML5 canvas? Does it uses WebGL and its GPU accelerated usage of physics and image processing in any way?
3
votes
1answer
1k views

Change default leaflet marker color

I'm using esri-leaflet, and leaflet inherently to add a point feature class (geojson) to a map. What is the best way to add and style the layer? I've see pointToLayer on the leafletjs.com, but don't ...
3
votes
1answer
162 views

Leaflet - Change style on click

I am beginer with Leaflet library and I am facing an issue with a geojson. I have an extern geojson file (points) and I would like to display a circle for each point coordinates and get a bigger ...
3
votes
1answer
191 views

How can I use Leaflet with esri-leaflet and ArcGIS Online services

I've used public ArcGIS Online services plenty of times in ESRI JS web apps and I imagine that using them as layers in Leaflet is pretty much the same. The one problem I can see is how would one ...
3
votes
1answer
325 views

Drag marker from outside to leaflet map

Is there any way to drag a marker from outside to the map using leaflet Api . Any suggestions plese help me?
3
votes
1answer
892 views

Multiple instance of leaflet on my page

I need a few pointers really; I've got a series of tabs running down the left hand of my page and on each page I have a leaflet map. Each map is based on the choropleth example but I'm running into ...
3
votes
1answer
367 views

Does leaflet support KML Ground Overlays?

I found an example showing KML overlays at http://harrywood.co.uk/maps/examples/leaflet/kml.html but it only plots vector layer using polygons. Is there any way to plot Ground overlays of KML (like ...
3
votes
1answer
3k views

CloudMade Routing with Leaflet: route is not displayed

I am trying to consume the CloudMade routing API using Leaflet. So far, I have managed to pass points and receive a response, and parse that response into an array of points. The array of points is ...
3
votes
1answer
879 views

Leaflet WMTS layer

I would like to start using Leaflet instead of OpenLayers, but I can't find a way to load WMTS layer into the map. Is that possible with Leaflet, or do I have to stick with OL? I haven't found ...
3
votes
1answer
3k views

How to set up a layer control using Leaflet?

I have been working on a mapping application using Leaflet. I am using a WMS on Geoserver to get my layers, which are overlaid on a cloudmade basemap. I tried to use the layer control on my map by ...
3
votes
1answer
162 views

How to set up a maximal zoom for polygons in Leaflet?

How to set up a maximal zoom for some layer, for example state polygons? I need that my US polygons which represent states have maxZoom 6, and when zoomed higher than 6, that US counties show up ...
3
votes
2answers
238 views

Leaflet geoJson in front of markers in a FeatureGroup

I am loading some markers and json data to a leaflet map. I need to get my json in front of the markers. I have tried placing the markers and json in seperate FeatureGroups and then tried ...
3
votes
1answer
470 views

Leaflet add and remove legends with layer selection

I'm new to Leaflet/Javascript and have been struggling to get legends a map to show only when a specific layer is selected from the layer control. I have three layers, one of which I would like to ...
3
votes
1answer
268 views

leaflet choropleth map using dynamic value

I am doing a choropleth map using leaflet and JSON data. I got a clean tutorial in leaflet site. In that tutorial the used us-states.js JSON file where the choropleth was based on the ...
3
votes
1answer
1k views

display a choropleth map using D3 and Leaftlet

I am trying to get a leaflet map to display a choropleth map using d3. I have written this code using samples I have found however the map just displays as the black fill, not the color classes I ...
3
votes
2answers
942 views

Leaflet offline tiles problem

I hate to ask this kind of questions, but i ve been stuck for 2 days now: I rendered some tiles with mapnik which i want to serve in my offline application which will run from a portable disk, but ...
3
votes
1answer
715 views

reusing cached tiles with leaflet, mbtiles and mbtiles-php

I am using Leaflet and infostream's fork of mbtiles-php to serve MBTiles stored on my server. I'm using a Leaflet layer group (and a layer control) to serve two MBTiles files. When I toggle between ...
3
votes
0answers
35 views

Adding an offset to a Leaflet TileLayer on the fly

I'm currently using Leaflet to display 18th century maps of Belgium as a base layer with a vector overlay of the present day road system. Although the maps are absolutely gorgeous ...
3
votes
1answer
30 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 ...
3
votes
0answers
47 views

How to update location via a data streame in openlayers or Leafletjs

I'm developing a application where I need to real-time update a Location of a Map using a data stream, I'm planing to use web-sockets, Are there any guides I can follow? Or can you guys direct me in ...
3
votes
1answer
352 views

Large loads geojson from mysql to leaflet?

I have a mysql database with +25K rows including geometry and other attributes. Using a mysql2geojson php script I then added it to a leaflet map. It is super slow now, what can I do to boost the ...
3
votes
0answers
453 views

Using Custom Map Projection On Leaflet

I have an application displaying a EPSG:3414 map running on Openlayers - jsfiddle working sample that works. I am trying to implement the same on Leaflet - jsfiddle non-working, it is not working as ...
3
votes
0answers
228 views

How do I format tilelayer.wms url properties such that I add an overlay iteratively to my base map in leaflet

My base map was created using hard-coded template variables. I am using the leaflet tilelayer.wms constructor and including the url like so: url: ...
3
votes
0answers
757 views

leaflet - Drawing line following the road

Short version: What I wish to be able to do is drawing a polyline along part of a road. In that way marking certain houses, along this road. Long Version: I have several houses that I wish to mark ...
3
votes
0answers
894 views

How to serve OpenStreetMap Tiles locally using ArcGIS Server 10?

We want to serve OpenStreetMap Tiles locally using ArcGis Server 10 to use as base maps in our ESRI Silverlight and Flex GIS clients. We've downloaded our regions OSM file and created PNGs using ...
3
votes
0answers
354 views

How do I pass a LatLng Bounds from Leaflet to Mapfish Print?

I successfully fired up a MapFish print server on Elastic Beanstalk, and it prints out the sample spec files fine, but I'm trying to pass bounds from my Leaflet frontend now, and encountering a lot of ...
2
votes
2answers
548 views

Do the recent developments in the Google Maps API replace necessity of OpenLayers?

I think the main drawback of the Google Maps API is that we can't add our own vector data or raster imagery as one of the layers in the map. Is this correct? Or is there any alternative in the Google ...
2
votes
3answers
9k views

How to get the Lat, Long of a clicked location using Leaflet API?

I am using OSM with leaflet API. Now i want to get the lat and long of a clicked location. I meant something similar to this. ex: http://openlayers.org/dev/examples/click.html ...
2
votes
3answers
2k views

get latitude & longitude as per address given for leaflet

In my project I am using leaflet to display points. I am getting address from my database & want to show point for that particular address. I dident found anything which will give me latitude ...
2
votes
2answers
75 views

zoom over vector in leaflet

I have created a map from geojson file of administrative boundaries (polygons layer). Similar to this example. When the mouse is over the polygon feature, the cursor changes from hand to finger. In ...
2
votes
4answers
105 views

Sites that demo freely available Basemaps

I've seen such sites in the past. I remember seeing one put together by Wm Lerer at a conference a couple years ago. What I'm looking for is a map that demonstrates all (well, at least a lot) of the ...
2
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 ...
2
votes
1answer
1k views

How to insert new line text in popup

I'm using Leaflet Marker Cluster and I need to show five different lines in a popup. But when I write this, they are all in the same line. Can someone help me to be one under another? var a = ...
2
votes
2answers
68 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 ?
2
votes
3answers
418 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?
2
votes
1answer
2k views

Disable leaflet interaction temporary

How can I temporary disable zoming/draging the Mapview in Leaflet.js Tried so many ways but without any luck. It's important to make it temporary and I also need the option to enable again.