diff --git a/categories/gastro.json b/categories/gastro.json
new file mode 100644
index 00000000..033fa315
--- /dev/null
+++ b/categories/gastro.json
@@ -0,0 +1,6 @@
+{
+ "query": "(node[amenity~'^(restaurant|cafe)$'];way[amenity~'^(restaurant|cafe)$'];relation[amenity~'^(restaurant|cafe)$'];);",
+ "minZoom": 16,
+ "markerSign": "{% if tags.amenity=='restaurant' %}🍴{% else %}☕{% endif %}",
+ "featureBody": "{{ tags.amenity }}
Cuisine: {{ tags.cuisine|default('unknown') }}"
+}
diff --git a/categories/parks.json b/categories/parks.json
new file mode 100644
index 00000000..9c5dcd41
--- /dev/null
+++ b/categories/parks.json
@@ -0,0 +1,10 @@
+{
+ "query": "(way[leisure=park];relation[leisure=park];)",
+ "style": {
+ "color": "green",
+ "fillColor": "green",
+ "fillOpacity": 0.2,
+ "weight": 2
+ },
+ "minZoom": 14
+}
diff --git a/categories/trees.json b/categories/trees.json
new file mode 100644
index 00000000..a8243456
--- /dev/null
+++ b/categories/trees.json
@@ -0,0 +1,18 @@
+{
+ "query": "node[natural=tree];",
+ "style": {
+ "nodeFeature": "CircleMarker",
+ "color": "red",
+ "fillColor": "red",
+ "fillOpacity": 0.1,
+ "weight": 1,
+ "radius": 6
+ },
+ "marker": {
+ "iconUrl": "img/map_pointer.png",
+ "iconSize": [ 25, 42 ],
+ "iconAnchor": [ 13, 42 ]
+ },
+ "minZoom": 17,
+ "featureTitle": "{{ tags.species|default('Tree') }}"
+}
diff --git a/index.js b/index.js
index 2fc2e017..b27e537c 100644
--- a/index.js
+++ b/index.js
@@ -1,6 +1,7 @@
var OverpassLayer = require('overpass-layer')
var OverpassLayerList = require('overpass-layer').List
var OverpassFrontend = require('overpass-frontend')
+var OpenStreetBrowserCategory = require('./src/OpenStreetBrowserCategory')
var map
@@ -19,63 +20,6 @@ window.onload = function() {
)
osm_mapnik.addTo(map)
- var overpass_layer = new OverpassLayer('node[natural=tree];', {
- style: {
- nodeFeature: 'CircleMarker',
- color: 'red',
- fillColor: 'red',
- fillOpacity: 0.1,
- weight: 1,
- radius: 6
- },
- marker: {
- iconUrl: 'img/map_pointer.png',
- iconSize: [ 25, 42 ],
- iconAnchor: [ 13, 42 ]
- },
- minZoom: 17,
- featureTitle: '{{ tags.species|default("Tree") }}',
- featureBody: function(ob) {
- return '
' + JSON.stringify(ob.tags, null, ' ') + '' - } - }) - //overpass_layer.addTo(map) - - var overpass_layer2 = new OverpassLayer('(way[leisure=park];relation[leisure=park];);', { - style: function(ob) { - return { - nodeFeature: 'CircleMarker', - color: 'green', - fillColor: 'green', - fillOpacity: 0.2, - weight: 1, - radius: 6 - } - }, - minZoom: 14, - featureBody: function(ob) { - return '
' + JSON.stringify(ob.tags, null, ' ') + '' - } - }) - //overpass_layer2.addTo(map) - - var overpass_layer3 = new OverpassLayer('(node[amenity~"^(restaurant|cafe)$"];way[amenity~"^(restaurant|cafe)$"];relation[amenity~"^(restaurant|cafe)$"];);', { - style: - "{% if tags.cuisine == 'italian' %}\n" + - " color: #003f7f\n" + - " fillColor: #003f7f\n" + - "{% else %}\n" + - " color: blue\n" + - " fillColor: blue \n" + - "{% endif %}\n" + - "fillOpacity: 0.2\n" + - "weight: 2\n" + - "radius: 9\n", - minZoom: 16, - markerSign: '{% if tags.amenity=="restaurant" %}🍴{% else %}☕{% endif %}', - featureBody: "{{ tags.amenity }}