Add gps track line, add documentation

This commit is contained in:
pietervdvn 2021-11-08 14:18:45 +01:00
parent 7b7076168f
commit d3d51af667
18 changed files with 278 additions and 145 deletions

View file

@ -17,7 +17,7 @@ export default class AllKnownLayers {
public static sharedLayersJson: Map<string, any> = AllKnownLayers.getSharedLayersJson();
public static added_by_default: string[] = ["gps_location", "home_location"]
public static added_by_default: string[] = ["gps_location", "home_location", "gps_track"]
public static no_include: string[] = [ "conflation", "left_right_style"]
/**
* Layer IDs of layers which have special properties through built-in hooks

View file

@ -67,7 +67,7 @@ export class AllKnownLayouts {
new List(AllKnownLayers.priviliged_layers.map(id => "[" + id + "](#" + id + ")")),
...AllKnownLayers.priviliged_layers
.map(id => AllKnownLayers.sharedLayers.get(id))
.map((l) => l.GenerateDocumentation(themesPerLayer.get(l.id), AllKnownLayers.added_by_default.indexOf(l.id) >= 0, AllKnownLayers.no_include.indexOf(l.id) >= 0)),
.map((l) => l.GenerateDocumentation(themesPerLayer.get(l.id), AllKnownLayers.added_by_default.indexOf(l.id) >= 0, AllKnownLayers.no_include.indexOf(l.id) < 0)),
new Title("Frequently reused layers", 1),
"The following layers are used by at least "+popularLayerCutoff+" mapcomplete themes and might be interesting for your custom theme too",
new List(popupalLayers.map(layer => "[" + layer.id + "](#" + layer.id + ")")),

View file

@ -12,6 +12,7 @@
- [gps_location](#gps_location)
- [home_location](#home_location)
- [gps_track](#gps_track)
- [type_node](#type_node)
- [conflation](#conflation)
- [left_right_style](#left_right_style)
@ -19,39 +20,85 @@
### gps_location
**This layer is included automatically in every theme. This layer might contain no points** [Go to the source code](../assets/layers/gps_location/gps_location.json) Meta layer showing the current location of the user. Add this to your theme and override the icon to change the appearance of the current location. The object will always have `id=gps` and will have _all_ the properties included in the [`Coordinates`-object](https://developer.mozilla.org/en-US/docs/Web/API/GeolocationCoordinates) returned by the browser.
- This layer can **not** be included in a theme. It is solely used by [special renderings](SpecialRenderings.md) showing a minimap with custom data.
Meta layer showing the current location of the user. Add this to your theme and override the icon to change the appearance of the current location. The object will always have `id=gps` and will have _all_ the properties included in the [`Coordinates`-object](https://developer.mozilla.org/en-US/docs/Web/API/GeolocationCoordinates) returned by the browser.
[Go to the source code](../assets/layers/gps_location/gps_location.json)
- **This layer is included automatically in every theme. This layer might contain no points**
- Not clickable by default. If you import this layer in your theme, override `title` to make this clickable
- Not visible in the layer selection by default. If you want to make this layer toggable, override `name`
### home_location
**This layer is included automatically in every theme. This layer might contain no points** [Go to the source code](../assets/layers/home_location/home_location.json) Meta layer showing the home location of the user. The home location can be set in the [profile settings](https://www.openstreetmap.org/profile/edit) of OpenStreetMap.
- This layer can **not** be included in a theme. It is solely used by [special renderings](SpecialRenderings.md) showing a minimap with custom data.
Meta layer showing the home location of the user. The home location can be set in the [profile settings](https://www.openstreetmap.org/profile/edit) of OpenStreetMap.
[Go to the source code](../assets/layers/home_location/home_location.json)
- **This layer is included automatically in every theme. This layer might contain no points**
- Not clickable by default. If you import this layer in your theme, override `title` to make this clickable
- Not visible in the layer selection by default. If you want to make this layer toggable, override `name`
### gps_track
Meta layer showing the previou locations of the user. Add this to your theme and override the icon to change the appearance of the current location.
[Go to the source code](../assets/layers/gps_track/gps_track.json)
- **This layer is included automatically in every theme. This layer might contain no points**
- Not visible in the layer selection by default. If you want to make this layer toggable, override `name`
### type_node
[Go to the source code](../assets/layers/type_node/type_node.json) This is a priviliged meta_layer which exports _every_ point in OSM. This only works if zoomed below the point that the full tile is loaded (and not loaded via Overpass). Note that this point will also contain a property `parent_ways` which contains all the ways this node is part of as a list. This is mainly used for extremely specialized themes, which do advanced conflations. Expert use only.
- This layer can **not** be included in a theme. It is solely used by [special renderings](SpecialRenderings.md) showing a minimap with custom data.
This is a priviliged meta_layer which exports _every_ point in OSM. This only works if zoomed below the point that the full tile is loaded (and not loaded via Overpass). Note that this point will also contain a property `parent_ways` which contains all the ways this node is part of as a list. This is mainly used for extremely specialized themes, which do advanced conflations. Expert use only.
[Go to the source code](../assets/layers/type_node/type_node.json)
- Not rendered on the map by default. If you want to rendering this on the map, override `mapRenderings`
### conflation
[Go to the source code](../assets/layers/conflation/conflation.json) If the import-button is set to conflate two ways, a preview is shown. This layer defines how this preview is rendered. This layer cannot be included in a theme.
If the import-button is set to conflate two ways, a preview is shown. This layer defines how this preview is rendered. This layer cannot be included in a theme.
[Go to the source code](../assets/layers/conflation/conflation.json)
- This layer can **not** be included in a theme. It is solely used by [special renderings](SpecialRenderings.md) showing a minimap with custom data.
### left_right_style
[Go to the source code](../assets/layers/left_right_style/left_right_style.json) Special meta-style which will show one single line, either on the left or on the right depending on the id. This is used in the small popups with left_right roads. Cannot be included in a theme
- Not clickable by default. If you import this layer in your theme, override `title` to make this clickable
- Not visible in the layer selection by default. If you want to make this layer toggable, override `name`
- Not rendered on the map by default. If you want to rendering this on the map, override `mapRenderings`
Special meta-style which will show one single line, either on the left or on the right depending on the id. This is used in the small popups with left_right roads. Cannot be included in a theme
[Go to the source code](../assets/layers/left_right_style/left_right_style.json)
- This layer can **not** be included in a theme. It is solely used by [special renderings](SpecialRenderings.md) showing a minimap with custom data.
Frequently reused layers
@ -68,14 +115,24 @@
### bicycle_library
[Go to the source code](../assets/layers/bicycle_library/bicycle_library.json) A facility where bicycles can be lent for longer period of times
A facility where bicycles can be lent for longer period of times
[Go to the source code](../assets/layers/bicycle_library/bicycle_library.json)
#### Themes using this layer
- [bicyclelib](https://mapcomplete.osm.be/bicyclelib)
- [cyclofix](https://mapcomplete.osm.be/cyclofix)
@ -83,14 +140,22 @@
### drinking_water
[Go to the source code](../assets/layers/drinking_water/drinking_water.json)
[Go to the source code](../assets/layers/drinking_water/drinking_water.json)
#### Themes using this layer
- [cyclofix](https://mapcomplete.osm.be/cyclofix)
- [drinking_water](https://mapcomplete.osm.be/drinking_water)
@ -99,14 +164,22 @@
### food
[Go to the source code](../assets/layers/food/food.json)
[Go to the source code](../assets/layers/food/food.json)
#### Themes using this layer
- [food](https://mapcomplete.osm.be/food)
- [fritures](https://mapcomplete.osm.be/fritures)
@ -114,14 +187,24 @@
### map
[Go to the source code](../assets/layers/map/map.json) A map, meant for tourists which is permanently installed in the public space
A map, meant for tourists which is permanently installed in the public space
[Go to the source code](../assets/layers/map/map.json)
#### Themes using this layer
- [maps](https://mapcomplete.osm.be/maps)
- [nature](https://mapcomplete.osm.be/nature)
@ -129,14 +212,22 @@
### all_streets
[Go to the source code](../assets/layers/all_streets/all_streets.json)
[Go to the source code](../assets/layers/all_streets/all_streets.json)
- Not rendered on the map by default. If you want to rendering this on the map, override `mapRenderings`
#### Themes using this layer
- [cyclestreets](https://mapcomplete.osm.be/cyclestreets)
- [street_lighting](https://mapcomplete.osm.be/street_lighting)

View file

@ -60,93 +60,6 @@
"description": "Layer 'Toilets' shows access=public with a fixed text, namely 'Public access' (in the MapComplete.osm.be theme 'Open Toilet Map')",
"value": "public"
},
{
"key": "access",
"description": "Layer 'Toilets' shows and asks freeform values for key 'access' (in the MapComplete.osm.be theme 'Open Toilet Map')"
},
{
"key": "access",
"description": "Layer 'Toilets' shows access=yes with a fixed text, namely 'Public access' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Open Toilet Map')",
"value": "yes"
},
{
"key": "access",
"description": "Layer 'Toilets' shows access=customers with a fixed text, namely 'Only access to customers' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Open Toilet Map')",
"value": "customers"
},
{
"key": "access",
"description": "Layer 'Toilets' shows access=no with a fixed text, namely 'Not accessible' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Open Toilet Map')",
"value": "no"
},
{
"key": "access",
"description": "Layer 'Toilets' shows access=key with a fixed text, namely 'Accessible, but one has to ask a key to enter' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Open Toilet Map')",
"value": "key"
},
{
"key": "access",
"description": "Layer 'Toilets' shows access=public with a fixed text, namely 'Public access' (in the MapComplete.osm.be theme 'Open Toilet Map')",
"value": "public"
},
{
"key": "access",
"description": "Layer 'Toilets' shows and asks freeform values for key 'access' (in the MapComplete.osm.be theme 'Open Toilet Map')"
},
{
"key": "access",
"description": "Layer 'Toilets' shows access=yes with a fixed text, namely 'Public access' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Open Toilet Map')",
"value": "yes"
},
{
"key": "access",
"description": "Layer 'Toilets' shows access=customers with a fixed text, namely 'Only access to customers' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Open Toilet Map')",
"value": "customers"
},
{
"key": "access",
"description": "Layer 'Toilets' shows access=no with a fixed text, namely 'Not accessible' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Open Toilet Map')",
"value": "no"
},
{
"key": "access",
"description": "Layer 'Toilets' shows access=key with a fixed text, namely 'Accessible, but one has to ask a key to enter' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Open Toilet Map')",
"value": "key"
},
{
"key": "access",
"description": "Layer 'Toilets' shows access=public with a fixed text, namely 'Public access' (in the MapComplete.osm.be theme 'Open Toilet Map')",
"value": "public"
},
{
"key": "access",
"description": "Layer 'Toilets' shows and asks freeform values for key 'access' (in the MapComplete.osm.be theme 'Open Toilet Map')"
},
{
"key": "access",
"description": "Layer 'Toilets' shows access=yes with a fixed text, namely 'Public access' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Open Toilet Map')",
"value": "yes"
},
{
"key": "access",
"description": "Layer 'Toilets' shows access=customers with a fixed text, namely 'Only access to customers' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Open Toilet Map')",
"value": "customers"
},
{
"key": "access",
"description": "Layer 'Toilets' shows access=no with a fixed text, namely 'Not accessible' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Open Toilet Map')",
"value": "no"
},
{
"key": "access",
"description": "Layer 'Toilets' shows access=key with a fixed text, namely 'Accessible, but one has to ask a key to enter' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Open Toilet Map')",
"value": "key"
},
{
"key": "access",
"description": "Layer 'Toilets' shows access=public with a fixed text, namely 'Public access' (in the MapComplete.osm.be theme 'Open Toilet Map')",
"value": "public"
},
{
"key": "fee",
"description": "Layer 'Toilets' shows fee=yes with a fixed text, namely 'These are paid toilets' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Open Toilet Map')",
@ -161,6 +74,25 @@
"key": "charge",
"description": "Layer 'Toilets' shows and asks freeform values for key 'charge' (in the MapComplete.osm.be theme 'Open Toilet Map')"
},
{
"key": "payment:cash",
"description": "Layer 'Toilets' shows payment:cash=yes with a fixed text, namely 'Cash is accepted here' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Open Toilet Map')",
"value": "yes"
},
{
"key": "payment:cards",
"description": "Layer 'Toilets' shows payment:cards=yes with a fixed text, namely 'Payment cards are accepted here' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Open Toilet Map')",
"value": "yes"
},
{
"key": "opening_hours",
"description": "Layer 'Toilets' shows and asks freeform values for key 'opening_hours' (in the MapComplete.osm.be theme 'Open Toilet Map')"
},
{
"key": "opening_hours",
"description": "Layer 'Toilets' shows opening_hours=24/7 with a fixed text, namely 'Opened 24/7' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Open Toilet Map')",
"value": "24/7"
},
{
"key": "wheelchair",
"description": "Layer 'Toilets' shows wheelchair=yes with a fixed text, namely 'There is a dedicated toilet for wheelchair users' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Open Toilet Map')",

View file

@ -184,13 +184,19 @@ export default class GeoLocationHandler extends VariableUiElement {
this.currentLocation = state.currentUserLocation
this._currentGPSLocation.addCallback((location) => {
self._previousLocationGrant.setData("granted");
console.log("Location is", location,)
const feature = {
"type": "Feature",
properties: {
id: "gps",
"user:location": "yes",
...location
"date": new Date().toISOString(),
"latitude": location.latitude,
"longitude": location.longitude,
"speed": location.speed,
"accuracy": location.accuracy,
"heading": location.heading,
"altitude": location.altitude
},
geometry: {
type: "Point",

View file

@ -28,7 +28,7 @@ export default class TitleHandler {
continue;
}
if (layer.source.osmTags.matchesProperties(tags)) {
const tagsSource = state.allElements.getEventSourceById(tags.id)
const tagsSource = state.allElements.getEventSourceById(tags.id) ?? new UIEventSource<any>(tags)
const title = new TagRenderingAnswer(tagsSource, layer.title)
return new Combine([defaultTitle, " | ", title]).ConstructElement()?.innerText ?? defaultTitle;
}

View file

@ -75,6 +75,7 @@ export default class FeaturePipeline {
constructor(
handleFeatureSource: (source: FeatureSourceForLayer & Tiled) => void,
state: {
readonly historicalUserLocations: FeatureSourceForLayer & Tiled;
readonly homeLocation: FeatureSourceForLayer & Tiled;
readonly currentUserLocation: FeatureSourceForLayer & Tiled;
readonly filteredLayers: UIEventSource<FilteredLayer[]>,
@ -127,7 +128,7 @@ export default class FeaturePipeline {
const perLayerHierarchy = new Map<string, TileHierarchyMerger>()
this.perLayerHierarchy = perLayerHierarchy
const patchedHandleFeatureSource = function (src: FeatureSourceForLayer & IndexedFeatureSource & Tiled) {
function patchedHandleFeatureSource (src: FeatureSourceForLayer & IndexedFeatureSource & Tiled) {
// This will already contain the merged features for this tile. In other words, this will only be triggered once for every tile
const srcFiltered =
new FilteringFeatureSource(state, src.tileIndex,
@ -139,6 +140,14 @@ export default class FeaturePipeline {
// We do not mark as visited here, this is the responsability of the code near the actual loader (e.g. overpassLoader and OSMApiFeatureLoader)
};
function handlePriviligedFeatureSource(src: FeatureSourceForLayer & Tiled){
// Passthrough to passed function, except that it registers as well
handleFeatureSource(src)
src.features.addCallbackAndRunD(fs => {
fs.forEach(ff => state.allElements.addOrGetElement(ff.feature))
})
}
for (const filteredLayer of state.filteredLayers.data) {
const id = filteredLayer.layerDef.id
@ -155,12 +164,17 @@ export default class FeaturePipeline {
}
if (id === "gps_location") {
hierarchy.registerTile(state.currentUserLocation)
handlePriviligedFeatureSource(state.currentUserLocation)
continue
}
if (id === "gps_track") {
handlePriviligedFeatureSource(state.historicalUserLocations)
continue
}
if (id === "home_location") {
hierarchy.registerTile(state.homeLocation)
handlePriviligedFeatureSource(state.homeLocation)
continue
}

View file

@ -22,7 +22,7 @@ export default class PerLayerFeatureSourceSplitter {
const knownLayers = new Map<string, FeatureSourceForLayer & Tiled>()
function update() {
const features = upstream.features.data;
const features = upstream.features?.data;
if (features === undefined) {
return;
}

View file

@ -135,6 +135,7 @@ export default class MapState extends UserRelatedState {
this.initHomeLocation()
this.initGpsLocation()
this.initUserLocationTrail()
}
public AddAllOverlaysToMap(leafletMap: UIEventSource<any>) {
@ -185,6 +186,46 @@ export default class MapState extends UserRelatedState {
let gpsLayerDef: FilteredLayer = this.filteredLayers.data.filter(l => l.layerDef.id === "gps_location")[0]
this.currentUserLocation = new SimpleFeatureSource(gpsLayerDef, Tiles.tile_index(0, 0, 0));
}
private initUserLocationTrail(){
const histCoordinates = []
let lineFeature = {
type:"Feature",
geometry:{
type: "LineString",
coordinates: histCoordinates
},
properties:{
"user:location":"yes",
"id":"gps_track"
}
}
const features = new UIEventSource<{feature: any, freshness: Date}[]>([], "gps_track")
let i = 0
this.currentUserLocation.features.addCallbackAndRunD(([location]) => {
if(location === undefined){
return;
}
const feature = JSON.parse(JSON.stringify(location.feature))
feature.properties.id = "gps/"+i
i++
console.log("New location: ", feature)
features.data.push({feature, freshness: new Date()})
histCoordinates.push(feature.geometry.coordinates)
if(lineFeature !== undefined && lineFeature.geometry.coordinates.length >= 2){
features.data.push({feature: lineFeature, freshness: new Date()})
lineFeature = undefined
}
features.ping()
})
let gpsLayerDef: FilteredLayer = this.filteredLayers.data.filter(l => l.layerDef.id === "gps_track")[0]
this.historicalUserLocations = new SimpleFeatureSource(gpsLayerDef, Tiles.tile_index(0, 0, 0), features);
}
private initHomeLocation() {
const empty = []
@ -225,7 +266,6 @@ export default class MapState extends UserRelatedState {
}
private InitializeFilteredLayers() {
// Initialize the filtered layers state
const layoutToUse = this.layoutToUse;
const empty = []

View file

@ -27,6 +27,22 @@ export default interface LineRenderingConfigJson {
*/
dashArray?: string | TagRenderingConfigJson
/**
* The form at the end of a line
*/
lineCap?: "round" | "square" | "butt" | string | TagRenderingConfigJson
/**
* Wehter or not to fill polygons
*/
fill?: "yes" | "no" | TagRenderingConfigJson
/**
* The color to fill a polygon with.
* If undefined, this will be slightly more opaque version of the stroke line
*/
fillColor?: string | TagRenderingConfigJson
/**
* The number of pixels this line should be moved.
* Use a positive numbe to move to the right, a negative to move to the left (left/right as defined by the drawing direction of the line).

View file

@ -397,6 +397,9 @@ export default class LayerConfig extends WithContextLoader {
const extraProps = []
if (canBeIncluded) {
if(addedByDefault){
extraProps.push("**This layer is included automatically in every theme. This layer might contain no points**" )
}
if (this.title === undefined) {
extraProps.push("Not clickable by default. If you import this layer in your theme, override `title` to make this clickable")
}
@ -410,6 +413,7 @@ export default class LayerConfig extends WithContextLoader {
extraProps.push("This layer can **not** be included in a theme. It is solely used by [special renderings](SpecialRenderings.md) showing a minimap with custom data.")
}
let usingLayer: BaseUIElement[] = []
if (usedInThemes?.length > 0 && !addedByDefault) {
@ -420,12 +424,13 @@ export default class LayerConfig extends WithContextLoader {
return new Combine([
new Title(this.id, 3),
addedByDefault ? "**This layer is included automatically in every theme. This layer might contain no points**" : undefined,
new Link("Go to the source code", `../assets/layers/${this.id}/${this.id}.json`),
this.description,
new Link("Go to the source code", `../assets/layers/${this.id}/${this.id}.json`),
new List(extraProps),
...usingLayer
])
]).SetClass("flex flex-col")
}
public CustomCodeSnippets(): string[] {

View file

@ -9,7 +9,10 @@ export default class LineRenderingConfig extends WithContextLoader {
public readonly color: TagRenderingConfig;
public readonly width: TagRenderingConfig;
public readonly dashArray: TagRenderingConfig;
public readonly lineCap: TagRenderingConfig;
public readonly offset: TagRenderingConfig;
public readonly fill: TagRenderingConfig;
public readonly fillColor: TagRenderingConfig;
public readonly leftRightSensitive: boolean
constructor(json: LineRenderingConfigJson, context: string) {
@ -17,6 +20,9 @@ export default class LineRenderingConfig extends WithContextLoader {
this.color = this.tr("color", "#0000ff");
this.width = this.tr("width", "7");
this.dashArray = this.tr("dashArray", "");
this.lineCap = this.tr("lineCap", "round");
this.fill = this.tr("fill", "round");
this.fillColor = this.tr("fillColor", "round");
this.leftRightSensitive = json.offset !== undefined && json.offset !== 0 && json.offset !== "0"
@ -24,12 +30,7 @@ export default class LineRenderingConfig extends WithContextLoader {
}
public GenerateLeafletStyle(tags: {}):
{
color: string,
weight: number,
dashArray: string,
offset: number
} {
{ fillColor: string; color: string; lineCap: string; offset: number; weight: number; dashArray: string; fill: string } {
function rendernum(tr: TagRenderingConfig, deflt: number) {
const str = Number(render(tr, "" + deflt));
const n = Number(str);
@ -55,13 +56,14 @@ export default class LineRenderingConfig extends WithContextLoader {
);
}
const weight = rendernum(this.width, 5);
const offset = rendernum(this.offset, 0)
return {
color,
weight,
dashArray,
offset
weight: rendernum(this.width, 5),
lineCap: render(this.lineCap),
offset: rendernum(this.offset, 0),
fill: render(this.fill),
fillColor: render(this.fillColor)
}
}

View file

@ -15,6 +15,9 @@ export default class TagRenderingAnswer extends VariableUiElement {
if (configuration === undefined) {
throw "Trying to generate a tagRenderingAnswer without configuration..."
}
if (tagsSource === undefined) {
throw "Trying to generate a tagRenderingAnswer without tagSource..."
}
super(tagsSource.map(tags => {
if (tags === undefined) {
return undefined;

View file

@ -158,7 +158,7 @@ export default class SpecialVisualizations {
}
],
example: "`{minimap()}`, `{minimap(17, id, _list_of_embedded_feature_ids_calculated_by_calculated_tag):height:10rem; border: 2px solid black}`",
constr: (state, tagSource, args) => {
constr: (state, tagSource, args, defaultGuiState) => {
const keys = [...args]
keys.splice(0, 1)
@ -172,6 +172,7 @@ export default class SpecialVisualizations {
// This is a list of values
idList = JSON.parse(value)
}
for (const id of idList) {
features.push({

View file

@ -3,7 +3,8 @@
"description": "Meta layer showing the current location of the user. Add this to your theme and override the icon to change the appearance of the current location. The object will always have `id=gps` and will have _all_ the properties included in the [`Coordinates`-object](https://developer.mozilla.org/en-US/docs/Web/API/GeolocationCoordinates) returned by the browser.",
"minzoom": 0,
"source": {
"osmTags": "user:location=yes"
"osmTags": "id=gps",
"maxCacheAge": 0
},
"mapRendering": [
{

View file

@ -0,0 +1,21 @@
{
"id": "gps_track",
"description": "Meta layer showing the previou locations of the user. Add this to your theme and override the icon to change the appearance of the current location.",
"minzoom": 0,
"source": {
"osmTags": "user:location=yes",
"maxCacheAge": 0
},
"name": "Your track",
"mapRendering": [
{
"icon": "circle:#f00",
"iconSize": "2,2,center",
"location": "point"
},
{
"width": 3,
"color": "#bb000077"
}
]
}

View file

@ -3,7 +3,8 @@
"description": "Meta layer showing the home location of the user. The home location can be set in the [profile settings](https://www.openstreetmap.org/profile/edit) of OpenStreetMap.",
"minzoom": 0,
"source": {
"osmTags": "user:home=yes"
"osmTags": "user:home=yes",
"maxCacheAge": 0
},
"mapRendering": [
{

View file

@ -471,12 +471,6 @@
}
}
],
"iconBadges": [
{
"if": "opening_hours~*",
"then": "isOpen"
}
],
"filter": [
{
"id": "is_open",
@ -574,6 +568,12 @@
}
]
},
"iconBadges": [
{
"if": "opening_hours~*",
"then": "isOpen"
}
],
"location": [
"point"
]