stadtnavi / digitransit-ui

Digitransit UI Clone, especially for the city of Herrenberg ("stadtnavi.de")
https://stadtnavi.de/
Other
13 stars 14 forks source link

Add POI Layers to layer switcher and map (DT) #833

Open hbruch opened 1 day ago

hbruch commented 1 day ago

The layer configuration and layers witcher should be extended to list new top level categories and layers according to the sheet POI-Layers list.

The layer configuration should -as much as possible- be generated from the google sheet. It should be possible to change e.g. label names, row order, rendering priorities.

The "layer" sheet currently lists POI-layers which are provides via a single vector tile-layer. Additional layers are currently listed in sheet "Layer Nicht OSM". (we plan to merge both sheets, which will require code changed to the poi generation code to ignore non-poi-layers)

Subcategories should be rendered with svg icons specified in column N (icon .svg) and colors . (Missing icons should be design as described in ticket )

Column W (minimales Zoomlevel) defines the minimum zoom level for each feature category. Column V (Priorisierung) defines the rendering priority and should be honored by the rendering: features with lower number should be displayed on top of other features with higher priority.

The current layer definitions in the sheet should reflect a layer tree as follows:

VectorTiles for POIs are available via https://features.stadtnavi.eu/

Note: as the app needs to display the equivalent layers, it might make sense to generate a json fragment which contains the appropriate configuration.

andreashelms commented 1 day ago

@hbruch @Denis306 I would suggest this JSON format for POIs/Layers.

A layer entry consists of code, de and en and can either have a property categories (if it contains more subcategories) or properties, which contains the layer type, source, icon and metadata.

I think it's a good idea to have the svg right inside this JSON-file to make the icons easily replaceable without touching any code.

Whether main categories or layers are editable or fixed needs to be configured in source spreadsheet (using e.g. protected cells).

This suggestion is open for discussion.

[
    {
        "code": "bike_car",
        "de": "Fahrrad & Auto",
        "en": "Bike & Car",
        "categories": [
            {
                "code": "bike_shops_rental",
                "de": "Fahrradläden und -verleih",
                "en": "Bike shops",
                "categories": [
                    {
                        "code": "bike_shop",
                        "de": "Fahrradladen",
                        "en": "Bike Shop",
                        "properties": {
                            "layer-type": "otp_layer",
                            "attributes": [
                                "opening_hours",
                                "wheelchair",
                                "contact",
                                "name",
                                "address",
                                "brand"
                            ],
                            "osm-filter": "shop\" = 'bicycle'",
                            "origin": "",
                            "icon": {
                                "svg": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg version=\"1.1\" id=\"bicycle\" xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"15\" viewBox=\"0 0 15 15\">\n  <path id=\"path4668\" d=\"&#xA;&#x9;M7.5,2c-0.6761-0.01-0.6761,1.0096,0,1H9v1.2656l-2.8027,2.334L5.2226,4H5.5c0.6761,0.01,0.6761-1.0096,0-1h-2&#xA;&#x9;c-0.6761-0.01-0.6761,1.0096,0,1h0.6523L5.043,6.375C4.5752,6.1424,4.0559,6,3.5,6C1.5729,6,0,7.5729,0,9.5S1.5729,13,3.5,13&#xA;&#x9;S7,11.4271,7,9.5c0-0.6699-0.2003-1.2911-0.5293-1.8242L9.291,5.3262l0.4629,1.1602C8.7114,7.0937,8,8.2112,8,9.5&#xA;&#x9;c0,1.9271,1.5729,3.5,3.5,3.5S15,11.4271,15,9.5S13.4271,6,11.5,6c-0.2831,0-0.5544,0.0434-0.8184,0.1074L10,4.4023V2.5&#xA;&#x9;c0-0.2761-0.2239-0.5-0.5-0.5H7.5z M3.5,7c0.5923,0,1.1276,0.2119,1.5547,0.5527l-1.875,1.5625&#xA;&#x9;c-0.5109,0.4273,0.1278,1.1945,0.6406,0.7695l1.875-1.5625C5.8835,8.674,6,9.0711,6,9.5C6,10.8866,4.8866,12,3.5,12S1,10.8866,1,9.5&#xA;&#x9;S2.1133,7,3.5,7L3.5,7z M11.5,7C12.8866,7,14,8.1134,14,9.5S12.8866,12,11.5,12S9,10.8866,9,9.5c0-0.877,0.4468-1.6421,1.125-2.0879&#xA;&#x9;l0.9102,2.2734c0.246,0.6231,1.1804,0.2501,0.9297-0.3711l-0.9082-2.2695C11.2009,7.0193,11.3481,7,11.5,7L11.5,7z\"/>\n</svg>",
                                "origin": "https://labs.mapbox.com/maki-icons/ bicycle",
                                "background_color": "#020813",
                                "color": "#FFFFFF"
                            },
                            "comment": "",
                            "osm_example": "",
                            "osm_wiki": "https://wiki.openstreetmap.org/wiki/Key:shop",
                            "overpass_query": "",
                            "priority": 1414,
                            "min_zoom": 15,
                            "url": ""
                        }
                    }
                ]
            }
        ]
    },
    {
        "code": "public_transit",
        "de": "Öffentlicher Nahverkehr",
        "en": "Public Transit",
        "categories": [
            {
                "code": "rail",
                "de": "Bahnhöfe",
                "en": "Train stations",
                "properties": {
                    "layer-type": "otp_layer",
                    [...]
                }
            }
        ]
    }   
]