Leaflet Dynamic JSON Layer

Example: Show Bars in Rome

Using: Overpass API

Service offer by
overpass-api.de

Data offer by OpenStreetMap.org
L.layerJSON({
	url: 'http://overpass-api.de/api/interpreter?data=[out:json];node({lat1},{lon1},{lat2},{lon2})[amenity=bar];out;',
	propertyItems: 'elements',
	propertyTitle: 'tags.name',
	propertyLoc: ['lat','lon'],
	buildPopup: function(data, marker) {
		return data.tags.name || null;
	}
}).addTo(map);
Labs
Fork me on GitHub