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

learn more… | top users | synonyms

1
vote
1answer
2k views

How to deal Leaflet map control checkboxes?

I add some geojson layers to the map control once a layer is loaded and the control can show all the layer names. But I notice that all the checkboxes are unchecked by default. So that once I click ...
1
vote
0answers
414 views

Allowing Add/Delete/Update of features (web application): OpenLayers + WFS and GeoServer?

I've developed a WPF application that has a custom SQL Server database and uses the Esri ArcGIS WPF API to allow users to view, edit and query shapes (features) on a custom map. Maps are created from ...
2
votes
2answers
3k views

How to label GeoJSON polygons?

I'm using Leaflet combined with GeoJSON features. Is there a way to label GeoJSON features (in this case - polygons)? It should get labels from feature.properties.name This is my code where I ...
-1
votes
2answers
212 views

Go to the URL on click with GeoJSON

I'm using Leaflet API and geojson. I defined a function which zooms to the feature when clicked: function zoomToFeature(e) { map.fitBounds(e.target.getBounds()); } function ...
4
votes
2answers
2k views

Click link inside Leaflet Popup and do javascript

I have a leaflet map up and running. It overlays a series of polygons (via GeoJSON) on the map and attaches popups to each polygon. Each of the popups display information about that polygon. I'd ...
0
votes
1answer
589 views

In leaflet does the addControl automatically handle events via the leaflet API?

I need to add additional overlay layers to be controlled by the controls within the leaflet map boundaries, but the code utilizes a leaflet-custom.js file. I am assuming it handles the event and ...
0
votes
0answers
102 views

How do I determine programmatically what values to add to the proj4js constructor for a CRS or SRS such that I can iteratively render proper overlays

I think this is primarily a GIS based question as far as for example: var crs = L.CRS.proj4js('EPSG:2154', '+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 ...
2
votes
1answer
1k views

How do I project my WMS tilelayer in leaflet if I want it to display as an overlay on my basemap if they have different EPSG?

So my basemap is a world Mercator projection and in wfs format and I'm trying to put a WMS overlay in a different projection over it? Leaflet's API didn't give me much info on changing the epsg so is ...
1
vote
0answers
229 views

When I try to do a WMS request to geoserver using the leaflet API I am getting a format related error

This XML file does not appear to have any style information associated with it. The document tree is shown below. <ows:ExceptionReport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ...
8
votes
2answers
9k views

Adding/Removing Leaflet GeoJSON layers

I'm trying to show different GeoJSON layers at different zoom layers using the Leaflet API. I can load and display all three layers at once (though I don't actually want them all to show at once). I ...
6
votes
2answers
3k views

Leaflet: How to move the layer-control menu?

This might be a silly question, but I could not find a documented way to achieve this. I'd like to freely position the layer-control menu, probably to the top left near the default zoom-in/out ...
6
votes
3answers
2k views

How do I stop event propagation with rightclick on Leaflet marker?

I didn't find a rightclick event in Leaflet markers so I started listening to the mousedown event. In the method that resolves this event I check if (event.originalEvent.button == 2) { ...
1
vote
1answer
92 views

Is a new map object required in order to create a wms overlay on top of a current map object with wfs layers using the leaflet api

I am trying to add a wms tile layer overlay over a wfs tile layer which I added to a map object. When I tried to simply add a layer on top of my current setView for my map object it overwrote the ...
1
vote
1answer
723 views

Does leaflet support wms tile layers in applications/openlayers formats?

I am trying to create a tilelayer.wms overlay on top of a wfs base map and I wasn't sure whether leaflet allows the applications/openlayers type of format which I served up from geoserver or only ...
0
votes
1answer
60 views

What kind of different results or what is the difference between two URL based WMS requests [closed]

I am trying to retrieve some WMS layers from geoserver so that I can display them in leaflet and I need to populate a URL field and I noticed that many of the layers that I opened up in openlayers had ...
3
votes
0answers
230 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: ...
5
votes
1answer
904 views

Is it possible to create filters based on attributes for markers in Leaflet?

I need to create filters based on attributes of markers. I have markers defined this way: var locations = [ ['AB11 5HW','17','A',57.147701,-2.085442 ] , ['AB11 8DG','3','B',57.129372,-2.090916 ] ...
5
votes
2answers
216 views

How to download Leaflet vectors in GPX format?

I would like to use the leaflet.draw plugin to allow users to digitize vectors on the map. At the end the data should be downloadable as a GPX-file. Is there any sample that shows how this can be ...
1
vote
1answer
4k views

location of a dragged and dropped marker using leaflet

I am using the leaflet API with OSM. I need to implement a functionality where on dragging the marker and dropping it on user preferred location, I need to get its latitude and longitude and save its ...
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 ...
3
votes
0answers
758 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 ...
2
votes
1answer
1k views

Leaflet, wrong API key when using CloudMade tiles!

I've registered on CloudMade and got some API keys but non of them work with Leaflet API. When I checked for image URLs and opened each directly using my browser it prints out the message "Wrong ...
-2
votes
1answer
363 views

how to customize the marker using leaflet

I am adding markers to the map as below: var markers = new L.LayerGroup(); L.marker([Latitude], [Longitude]).bindPopup("Hi there").addTo(markers); map.addLayer(markers); I have my own marker ...
3
votes
0answers
896 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 ...
2
votes
1answer
676 views

How to preload tiles in Leaflet?

I'm trying to make a user controlled cross-layer animation in Leaflet. I have about 70 tileLayer.wms layers, that need to be preloaded on the map before animation can run. The question is - is there ...
5
votes
1answer
3k 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',{ ...
2
votes
2answers
2k views

leaflet and geojson tiles

New to mapping. Trying to create a heat map with data that updates every hour for US Counties with leaflet.js similar to http://leaflet.cloudmade.com/examples/choropleth-example.html. But, adding ...
2
votes
1answer
567 views

formatting geojson from postgis data using node.js

I am trying to build a GeoJSON object from a SQL query to some GIS point data in a postgis postgresql database. A snippet of my node.js app.js is below. As it stands I understand building the type ...
4
votes
2answers
2k views

Leaflet drop markers animation

Is it possible to do drop markers on the map like in google maps (https://google-developers.appspot.com/maps/documentation/javascript/examples/marker-animations-iteration) in leaflet
2
votes
1answer
164 views

Is it necessary to add Tile layer background?

Is it necessary to add tile layer for making a GeoJSON data rendered in web browser using Leaflet or any other API ? I have a geoJSON data (I obtained the GeoJSON data by converting .shp file to ...
13
votes
6answers
3k views

Visualizing large datasets with Leaflet

When using Leaflet to visualize a large dataset (GeoJSON with 10,000 point features), not surprisingly the browser crashes or hangs. A sub-sample of 1000 features from the same dataset works ...
1
vote
0answers
430 views

Leaflet markers do not open popup on click (with markerclusterer)

I just started using Leaflet and Marker Clusterer to organize the markers. Problem #1: When an unclustered marker is clicked, no popup appears. Problem #2: When a cluster is clicked several times, ...
2
votes
1answer
1k views

How to setup leaflet map to display a WMS layer in ESRI:102012 projection?

I have a WMS server that serves layers in ESRI:102012 projection. http://spatialreference.org/ref/esri/102012/ It accepts GetMap requests with srs=EPSG:102012 parameter. My goal is to display a map ...
1
vote
0answers
281 views

How to access arcgis cache directly using leaflet like openlayers?

I want to access arcgis server cache dircetly by only using leaflet,I wrote some code,but it work badly,could you anyone give me any hints? my code: getTileUrl: function (tilePoint) { var zoom = ...
34
votes
4answers
15k 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 ...
2
votes
2answers
5k views

How do I overlay a KML on leaflet 0.4.4

I am using Leaflet 0.4.4, I have a KML I would like to overlay on the map, how do I go about doing this? Edit: I am already aware of https://github.com/CloudMade/Leaflet/issues/14, which directs ...
4
votes
1answer
2k views

How to add a geoJSON layer to leaflet map?

i am newbie in leaflet & its geojson features... I am trying to test leaflet's functionalities. In fact i have built a map and its layer: var map = new L.map('map', {scrollWheelZoom:true, ...
2
votes
1answer
853 views

LEAFLET - store and retrieve user markers & diagrams from database

I am intending to use leaflet in order to build a "microscope laboratory" for my institute's medical school. I am quite new to javascript, ajax and json technologies so I would like to have some ...
1
vote
1answer
2k views

How to plot multiple markers on a leaflet map?

If I have a object containing lats and longs how can i plot them in leaflet using the marker constructor I tried looping through them for(key in obj){ var val = obj[key]; ...
5
votes
1answer
1k views

What is the difference between Leaflet and Mapbox?

What is the difference between Leaflet and Mapbox, and how are they used together? Like the API and what exactly are they and is Mapbox using Leaflet?
5
votes
1answer
4k views

How to open popup on mouseover in Leaflet? [duplicate]

Possible Duplicate: How to show a popup on mouse-over, not on click? I'm working with Leaflet library. I defined L.layerGroup and add some markers to the group. Can somebody help me with ...
1
vote
1answer
287 views

Does Leaflet always work in decimal degrees?

I'm looking into Leaflet and I'm surprised that it doesn't (seem to) specify coordinates in Web Mercator like other popular APIs, but instead uses decimal degrees. Are all coordinates in Leaflet ...
0
votes
1answer
456 views

Is it possible to show markers from MySQL database with Javascript?

I'm interested if it's possible to show markers (latit, longit) from MySQL database with Javascript libraries like Leaflet?
2
votes
1answer
2k views

How to change icons for Leaflet markers when using cluster plugin?

I'm using Leaflet MarkerCluster. I created a MarkerClusterGroup as markers1 as you can see. There's about a hundred points I have written like var addressPoints in this format: var addressPoints = ...
10
votes
4answers
9k 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
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 = ...
4
votes
1answer
3k views

Leaflet marker cluster and popups

I want to develop a map with Leaflet marker cluster. You can see how it looks like here: https://github.com/danzel/Leaflet.markercluster But I need that my markers have popups with more information ...
1
vote
1answer
3k views

Syling Leaflet Maps

Is there anyway to style base maps using Leaflet? I know there are quite a few options for loading different pre-made styles (such as Stamen, Mapbox, etc...), but I am looking for a way to create my ...
10
votes
3answers
3k views

Examples of leaflet interactive mapping applications

I would like to develop a simple mapping application. One where users can digitize lines, polygons and points and attribute the features. The attributes will then be stored in a database for later ...
-2
votes
1answer
139 views

Upgrade Leaflet to 0.4, how to start?

I have an app based on leaflet 0.3.1 and it is time to upgrade to 0.4 !!! Nice ! So, what to do now ! Obviously, our map is absent in the browser, so let's have a look inside our files. Well, i have ...