Refactoring of GPS-location (uses featureSource too now), factoring out state, add ReplaceGeometryAction and conflation example

This commit is contained in:
Pieter Vander Vennet 2021-11-03 00:44:53 +01:00
parent 1db54f3c8e
commit 2484848cd6
37 changed files with 1035 additions and 467 deletions

View file

@ -0,0 +1,32 @@
{
"id": "conflation",
"description": "This is a special meta_layer which render geometry-changes for inspection",
"minzoom": 1,
"source": {
"osmTags": {
"or": ["move=yes","newpoint=yes"]
}
},
"name": "Conflation",
"title": "Conflation",
"mapRendering": [
{
"location": "point",
"icon": "addSmall:#000",
"iconSize": "10,10,center"
},
{
"location": "end",
"icon": "circle:#0f0",
"iconSize": "10,10,center"
},{
"location": "start",
"icon": "square:#f00",
"iconSize": "10,10,center"
},
{
"width": "3",
"color": "#00f"
}
]
}

View file

@ -0,0 +1,15 @@
{
"id": "gps_location",
"description": "Meta layer showing the current location of the user",
"minzoom": 0,
"source": {
"osmTags": "user:location=yes"
},
"mapRendering": [
{
"icon": "crosshair:#00f",
"iconSize": "40,40,center",
"location": "point"
}
]
}

View file

@ -1,35 +1,19 @@
{
"id": "home_location",
"description": "Meta layer showing the home location of the user",
"minzoom": 0,
"source": {
"osmTags": "user:home=yes"
},
"icon": {
"id": "home_location",
"description": "Meta layer showing the home location of the user",
"minzoom": 0,
"source": {
"osmTags": "user:home=yes"
},
"mapRendering": [
{
"icon": {
"render": "circle:white;./assets/svg/home.svg"
},
"iconSize": {
},
"iconSize": {
"render": "20,20,center"
},
"color": {
"render": "#00f"
},
"mapRendering": [
{
"icon": {
"render": "circle:white;./assets/svg/home.svg"
},
"iconSize": {
"render": "20,20,center"
},
"location": [
"point"
]
},
{
"color": {
"render": "#00f"
}
}
]
},
"location": "point"
}
]
}

View file

@ -235,11 +235,6 @@
}
],
"mapRendering": [
{
"location": [
"point"
]
},
{
"color": {
"render": "#ff7392",

View file

@ -38,7 +38,9 @@
"override": {
"calculatedTags": [
"_is_part_of_building=feat.get('parent_ways')?.some(p => p.building !== undefined && p.building !== '') ?? false",
"_is_part_of_landuse=feat.get('parent_ways')?.some(p => (p.landuse !== undefined && p.landuse !== '') || (p.natural !== undefined && p.natural !== '')) ?? false"
"_is_part_of_building_passage=feat.get('parent_ways')?.some(p => p.tunnel === 'building_passage') ?? false",
"_is_part_of_highway=!feat.get('is_part_of_building_passage') && (feat.get('parent_ways')?.some(p => p.highway !== undefined && p.highway !== '') ?? false)",
"_is_part_of_landuse=feat.get('parent_ways')?.some(p => (p.landuse !== undefined && p.landuse !== '') || (p.natural !== undefined && p.natural !== '')) ?? false"
]
}
},
@ -674,7 +676,7 @@
"mappings": [
{
"if": "_overlaps_with!=null",
"then": "Cannot be imported directly, there is a nearly identical building geometry in OpenStreetMap"
"then": "{import_button(OSM-buildings,building=$building; source:geometry:date=$_grb_date; source:geometry:ref=$_grb_ref, Replace the geometry in OpenStreetMap,,,_osm_obj:id)}"
}
]
},