forked from MapComplete/MapComplete
PDF-export: the time-sensitive icons (notably hopening_hours) are now hidden
This commit is contained in:
parent
fb193123e0
commit
24b9f045c8
5 changed files with 14 additions and 4 deletions
|
@ -63,7 +63,8 @@
|
||||||
},
|
},
|
||||||
"then": "circle:#f0f;clock:#fff"
|
"then": "circle:#f0f;clock:#fff"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"metacondition": "__showTimeSensitiveIcons!=no"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "phonelink",
|
"id": "phonelink",
|
||||||
|
|
|
@ -86,7 +86,7 @@
|
||||||
"_direction:leftright~*"
|
"_direction:leftright~*"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"then": "100,35,center"
|
"then": "50,35,center"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"render": "35,35,center"
|
"render": "35,35,center"
|
||||||
|
|
|
@ -36,7 +36,8 @@
|
||||||
isExporting = true
|
isExporting = true
|
||||||
const gpsLayer = state.layerState.filteredLayers.get(<PriviligedLayerType>"gps_location")
|
const gpsLayer = state.layerState.filteredLayers.get(<PriviligedLayerType>"gps_location")
|
||||||
state.lastClickObject.features.setData([])
|
state.lastClickObject.features.setData([])
|
||||||
|
state.userRelatedState.preferencesAsTags.data["__showTimeSensitiveIcons"] = "no"
|
||||||
|
state.userRelatedState.preferencesAsTags.ping()
|
||||||
const gpsIsDisplayed = gpsLayer.isDisplayed.data
|
const gpsIsDisplayed = gpsLayer.isDisplayed.data
|
||||||
try {
|
try {
|
||||||
gpsLayer.isDisplayed.setData(false)
|
gpsLayer.isDisplayed.setData(false)
|
||||||
|
@ -68,6 +69,9 @@
|
||||||
} finally {
|
} finally {
|
||||||
isExporting = false
|
isExporting = false
|
||||||
gpsLayer.isDisplayed.setData(gpsIsDisplayed)
|
gpsLayer.isDisplayed.setData(gpsIsDisplayed)
|
||||||
|
state.userRelatedState.preferencesAsTags.data["__showTimeSensitiveIcons"] = "yes"
|
||||||
|
state.userRelatedState.preferencesAsTags.ping()
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -27,12 +27,14 @@ class PointRenderingLayer {
|
||||||
private readonly _allMarkers: Map<string, Marker> = new Map<string, Marker>()
|
private readonly _allMarkers: Map<string, Marker> = new Map<string, Marker>()
|
||||||
private readonly _selectedElement: Store<{ properties: { id?: string } }>
|
private readonly _selectedElement: Store<{ properties: { id?: string } }>
|
||||||
private readonly _markedAsSelected: HTMLElement[] = []
|
private readonly _markedAsSelected: HTMLElement[] = []
|
||||||
|
private readonly _metatags: Store<Record<string, string>>
|
||||||
private _dirty = false
|
private _dirty = false
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
map: MlMap,
|
map: MlMap,
|
||||||
features: FeatureSource,
|
features: FeatureSource,
|
||||||
config: PointRenderingConfig,
|
config: PointRenderingConfig,
|
||||||
|
metatags?: Store<Record<string, string>>,
|
||||||
visibility?: Store<boolean>,
|
visibility?: Store<boolean>,
|
||||||
fetchStore?: (id: string) => Store<Record<string, string>>,
|
fetchStore?: (id: string) => Store<Record<string, string>>,
|
||||||
onClick?: (feature: Feature) => void,
|
onClick?: (feature: Feature) => void,
|
||||||
|
@ -41,6 +43,7 @@ class PointRenderingLayer {
|
||||||
this._visibility = visibility
|
this._visibility = visibility
|
||||||
this._config = config
|
this._config = config
|
||||||
this._map = map
|
this._map = map
|
||||||
|
this._metatags = metatags
|
||||||
this._fetchStore = fetchStore
|
this._fetchStore = fetchStore
|
||||||
this._onClick = onClick
|
this._onClick = onClick
|
||||||
this._selectedElement = selectedElement
|
this._selectedElement = selectedElement
|
||||||
|
@ -143,7 +146,7 @@ class PointRenderingLayer {
|
||||||
} else {
|
} else {
|
||||||
store = new ImmutableStore(<OsmTags>feature.properties)
|
store = new ImmutableStore(<OsmTags>feature.properties)
|
||||||
}
|
}
|
||||||
const { html, iconAnchor } = this._config.RenderIcon(store)
|
const { html, iconAnchor } = this._config.RenderIcon(store, { metatags: this._metatags })
|
||||||
html.SetClass("marker")
|
html.SetClass("marker")
|
||||||
if (this._onClick !== undefined) {
|
if (this._onClick !== undefined) {
|
||||||
html.SetClass("cursor-pointer")
|
html.SetClass("cursor-pointer")
|
||||||
|
@ -525,6 +528,7 @@ export default class ShowDataLayer {
|
||||||
map,
|
map,
|
||||||
features,
|
features,
|
||||||
pointRenderingConfig,
|
pointRenderingConfig,
|
||||||
|
this._options.metaTags,
|
||||||
doShowLayer,
|
doShowLayer,
|
||||||
fetchStore,
|
fetchStore,
|
||||||
onClick,
|
onClick,
|
||||||
|
|
|
@ -35,4 +35,5 @@ export interface ShowDataLayerOptions {
|
||||||
fetchStore?: (id: string) => Store<Record<string, string>>
|
fetchStore?: (id: string) => Store<Record<string, string>>
|
||||||
|
|
||||||
onClick?: (feature: Feature) => void
|
onClick?: (feature: Feature) => void
|
||||||
|
metaTags?: Store<Record<string, string>>
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue