forked from MapComplete/MapComplete
Inject a few functions to fix the build
This commit is contained in:
parent
45bf08744f
commit
ef18846c6a
2 changed files with 19 additions and 7 deletions
9
index.ts
9
index.ts
|
@ -16,10 +16,19 @@ import CountryCoder from "latlon2country"
|
|||
import SimpleMetaTagger from "./Logic/SimpleMetaTagger";
|
||||
import Minimap from "./UI/Base/Minimap";
|
||||
import DirectionInput from "./UI/Input/DirectionInput";
|
||||
import SpecialVisualizations from "./UI/SpecialVisualizations";
|
||||
import ShowDataLayer from "./UI/ShowDataLayer";
|
||||
import * as L from "leaflet";
|
||||
|
||||
// Workaround for a stupid crash: inject some functions which would give stupid circular dependencies or crash the other nodejs scripts
|
||||
SimpleMetaTagger.coder = new CountryCoder("https://pietervdvn.github.io/latlon2country/");
|
||||
DirectionInput.constructMinimap = options => new Minimap(options)
|
||||
SpecialVisualizations.constructMiniMap = options => new Minimap(options)
|
||||
SpecialVisualizations.constructShowDataLayer = (features: UIEventSource<{ feature: any, freshness: Date }[]>,
|
||||
leafletMap: UIEventSource<L.Map>,
|
||||
layoutToUse: UIEventSource<LayoutConfig>,
|
||||
enablePopups = true,
|
||||
zoomToFeatures = false) => new ShowDataLayer(features, leafletMap, layoutToUse, enablePopups, zoomToFeatures)
|
||||
|
||||
let defaultLayout = ""
|
||||
// --------------------- Special actions based on the parameters -----------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue