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

learn more… | top users | synonyms (1)

3
votes
3answers
5k 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 ...
3
votes
3answers
261 views

Offline Map Service with Mapnik and Leaflet

I'm relatively new to GIS, so I hope my asking doesn't appear to be ignorant in any way. I currently work on an offline map service solution for usage in areas without internet connection. For that ...
3
votes
3answers
426 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 ...
3
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 ...
3
votes
3answers
1k views

How to add a polygon from PostGIS ST_AsGeoJSON into Leaflet?

I try to use the following function to add polygons to my Leaflet map. function polygon(geojson) { alert(geojson); // alert for testing layer = L.geoJson(geojson); layer.addTo(map); } ...
3
votes
2answers
134 views

Convert data to another Coordinate Reference System

Assuming I've a point like this : POINT (751318 9760879) This point is in EPSG:27700 coordinate reference system. How do I convert the point to display in a map with EPSG3857 coordinate ...
3
votes
3answers
367 views

Leaflet and ArcGIS Geoprocessing Service

Does anyone know of an example of a leaflet map with a geoprocessing service? Is it possible? What would the code look like? I know ESRI Leaflet allows feature layers and map layers but I can't find ...
3
votes
2answers
574 views

GeoJSON formatting for Leaflet

I am using http://GeoJSON.io as the source for my data, which is then to be displayed via Leaflet.js. I found that leaflet neads the file to include "var name = {" but GeoJSON.io doesn't like it, ...
3
votes
4answers
1k views

Display GeoJSON layer on top a SVG image instead of a map.

I'm very new to GIS, so hope this is the correct place to ask. Not sure if this will even be possible. This is what I want to achieve: In short, I want to display a set of polygons, lines etc. in a ...
3
votes
2answers
452 views

Slippy map format

When do you decide which to use? I've started using Geoserver and it seems like map files are downloaded to the browser (using Leaflet) in the WFS format. When I look at OSM, Mapbox etc, they use ...
3
votes
1answer
810 views

How to avoid corrupt geometries when translating between TopoJSON and GeoJSON?

I'm trying to display some geojson vector features on a leaflet map. The size of my GeoJSON is too big (25.4mb of data, 8.47mb gzipped), so I'm trying to use a TopoJSON format to reduce the size ...
3
votes
1answer
612 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
34 views

Loss of synchronization between map and markers (Leaflet + Google Maps)

I have a problem using the markers with Google Maps with Leaflet. In this example you can see the difference between Google Maps or OSM. Using OSM, the marker moves with the map but when using Google ...
3
votes
2answers
786 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
305 views

Leaflet rendering TileMill tiles in the wrong order

I'm stumped, and quite a lot of searching has turned up nothing helpful. I'm on the first step of what will ultimately be a map with three raster layers and three layers of markers (with controls to ...
3
votes
1answer
3k 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
87 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
181 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
108 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
2answers
101 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
379 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
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 ...
3
votes
1answer
5k 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
99 views

How to make transparent the background of a WMS layer in Leaflet

I have inserted the following layer from a geoserver in the following Leaflet map : var nexrad = new L.TileLayer.WMS("URL", { layers: 'Wrecks:WrecksGreaterNorthSea', format: 'image/png', ...
3
votes
1answer
69 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
2answers
80 views

How to update location via a data stream in OpenLayers or Leaflet?

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
514 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
228 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
381 views

Options for getting data from SQL Server into Leaflet app?

I have polygon data in SQL Server 2012 that I need to get onto a Leaflet application - we're not talking thousands of polygons, but simplified U.S. counties where only one state will be displayed at a ...
3
votes
1answer
411 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
1k 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
387 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
941 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
167 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
1answer
13 views

Leaflet: Change point icon (geoJSON) on click and change back when clicking another point

I would be very grateful if someone could help me with this. I have a geoJSON (10 points) that is drawn using an icon. I want to change the icon when I click on one of the points and then I want to ...
3
votes
2answers
354 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
687 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
294 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
1answer
746 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
46 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
38 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
1answer
515 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
494 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
240 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: ...