Leaflet Layer OverPass
=============================
[](http://badge.fury.io/bo/leaflet-layer-overpass)
## What is it?
A [Leaflet](http://leafletjs.com/) plugin to create a custom POI overlay - thanks to the [OSM](http://www.openstreetmap.org/) dataset and the [Overpass API](http://overpass-api.de/)
checkout the [demo](http://kartenkarsten.github.io/leaflet-layer-overpass/demo/)
## Installation
You can use bower to install leaflet-layer-overpass.
Simply run
```bash
$ bower install --save leaflet-layer-overpass
```
After that you can include and use the `OverpassLayer.css` and `OverpassLayer.js` files (or `OverPassLayer.min.js` if you want the minified version) from the `dist` folder in your html.
## How to use it?
```javascript
var attr_osm = 'Map data © OpenStreetMap contributors',
attr_overpass = 'POI via Overpass API';
var osm = new L.TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {opacity: 0.7, attribution: [attr_osm, attr_overpass].join(', ')});
var map = new L.Map('map').addLayer(osm).setView(new L.LatLng(52.265, 10.524), 14);
//OverPassAPI overlay
var opl = new L.OverPassLayer({
query: "node(BBOX)['amenity'='post_box'];out;",
});
map.addLayer(opl);
```
In order to get a valid query the [Overpass-turbo IDE](http://overpass-turbo.eu/) might help.
## What are the options?
You can specify an options object as an argument of L.OverPassLayer.
```javascript
options: {
endpoint: "http://overpass.osm.rambler.ru/cgi/",
query: "node(BBOX)['amenity'='post_box'];out;",
debug: false,
callback: function(data) {
for(var i=0;i geoJSON to -> Leaflet Layer to support ways and areas as well (see also [PoiMap](https://github.com/simon04/POImap/blob/master/railway.html), [OverPassTurbo](https://github.com/tyrasd/overpass-ide/blob/gh-pages/js/overpass.js))
- improve popup text. use links, format addresses and contact details (compare with [OpenLinkMap](http://www.openlinkmap.org/))
- improve caching - allow to store data for some days in browser