Small code cleanups, documentation
This commit is contained in:
parent
cb42a4fcc5
commit
085d762bff
4 changed files with 37 additions and 34 deletions
|
@ -8,6 +8,7 @@ import TagRenderingAnswer from "./TagRenderingAnswer";
|
|||
import State from "../../State";
|
||||
import TagRenderingConfig from "../../Customizations/JSON/TagRenderingConfig";
|
||||
import ScrollableFullScreen from "../Base/ScrollableFullScreen";
|
||||
import {Utils} from "../../Utils";
|
||||
|
||||
export default class FeatureInfoBox extends ScrollableFullScreen {
|
||||
private static featureInfoboxCache: Map<LayerConfig, Map<UIEventSource<any>, FeatureInfoBox>> = new Map<LayerConfig, Map<UIEventSource<any>, FeatureInfoBox>>();
|
||||
|
@ -24,18 +25,8 @@ export default class FeatureInfoBox extends ScrollableFullScreen {
|
|||
}
|
||||
|
||||
static construct(tags: UIEventSource<any>, layer: LayerConfig): FeatureInfoBox {
|
||||
let innerMap = FeatureInfoBox.featureInfoboxCache.get(layer);
|
||||
if (innerMap === undefined) {
|
||||
innerMap = new Map<UIEventSource<any>, FeatureInfoBox>();
|
||||
FeatureInfoBox.featureInfoboxCache.set(layer, innerMap);
|
||||
}
|
||||
|
||||
let featureInfoBox = innerMap.get(tags);
|
||||
if (featureInfoBox === undefined) {
|
||||
featureInfoBox = new FeatureInfoBox(tags, layer);
|
||||
innerMap.set(tags, featureInfoBox);
|
||||
}
|
||||
return featureInfoBox;
|
||||
let innerMap = Utils.getOrSetDefault(FeatureInfoBox.featureInfoboxCache, layer,() => new Map<UIEventSource<any>, FeatureInfoBox>())
|
||||
return Utils.getOrSetDefault(innerMap, tags, () => new FeatureInfoBox(tags, layer));
|
||||
}
|
||||
|
||||
private static GenerateTitleBar(tags: UIEventSource<any>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue