Improve the precise input element, normalize 'and' to check if it is empty (and to check if no filter is active)

This commit is contained in:
Pieter Vander Vennet 2021-09-08 01:36:44 +02:00
parent 475b89a794
commit a4f4365d71
10 changed files with 262 additions and 28 deletions

View file

@ -18,7 +18,7 @@ export default class Minimap extends BaseUIElement {
private _allowMoving: boolean;
private readonly _leafletoptions: any;
private readonly _onFullyLoaded: (leaflet: L.Map) => void
private readonly _attribution: BaseUIElement;
private readonly _attribution: BaseUIElement | boolean;
private readonly _lastClickLocation: UIEventSource<{ lat: number; lon: number }>;
constructor(options?: {
@ -26,7 +26,7 @@ export default class Minimap extends BaseUIElement {
location?: UIEventSource<Loc>,
allowMoving?: boolean,
leafletOptions?: any,
attribution?: BaseUIElement,
attribution?: BaseUIElement | boolean,
onFullyLoaded?: (leaflet: L.Map) => void,
leafletMap?: UIEventSource<Map>,
lastClickLocation?: UIEventSource<{ lat: number, lon: number }>
@ -122,8 +122,12 @@ export default class Minimap extends BaseUIElement {
);
if (this._attribution !== undefined) {
if(this._attribution === true){
map.attributionControl.setPrefix(false)
}else{
map.attributionControl.setPrefix(
"<span id='leaflet-attribution'>A</span>");
"<span id='leaflet-attribution'></span>");
}
}
this._background.addCallbackAndRun(layer => {
@ -141,7 +145,9 @@ export default class Minimap extends BaseUIElement {
}
map.addLayer(newLayer);
map.setMaxZoom(layer.max_zoom ?? map.getMaxZoom())
self._attribution?.AttachTo('leaflet-attribution')
if (self._attribution !== true && self._attribution !== false) {
self._attribution?.AttachTo('leaflet-attribution')
}
})