mapcomplete/test.ts

51 lines
1.5 KiB
TypeScript
Raw Normal View History

2021-09-29 19:49:42 +02:00
<<<<<<< HEAD
import {Tiles} from "./Models/TileRange";
import OsmFeatureSource from "./Logic/FeatureSource/TiledFeatureSource/OsmFeatureSource";
import {Utils} from "./Utils";
import {AllKnownLayouts} from "./Customizations/AllKnownLayouts";
import LayerConfig from "./Models/ThemeConfig/LayerConfig";
2021-07-28 02:51:07 +02:00
const allLayers: LayerConfig[] = []
const seenIds = new Set<string>()
for (const layoutConfig of AllKnownLayouts.layoutsList) {
if (layoutConfig.hideFromOverview) {
continue
}
for (const layer of layoutConfig.layers) {
if (seenIds.has(layer.id)) {
continue
}
seenIds.add(layer.id)
allLayers.push(layer)
}
}
console.log("All layer ids", allLayers.map(l => l.id))
const src = new OsmFeatureSource({
backend: "https://www.openstreetmap.org",
handleTile: tile => console.log("Got tile", tile),
allLayers: allLayers
})
src.LoadTile(16, 33354, 21875).then(geojson => {
console.log("Got geojson", geojson);
Utils.offerContentsAsDownloadableFile(JSON.stringify(geojson), "test.geojson", {
mimetype: "application/vnd.geo+json"
})
})
2021-09-29 19:49:42 +02:00
//*/
=======
import LocationInput from "./UI/Input/LocationInput";
import Loc from "./Models/Loc";
import {UIEventSource} from "./Logic/UIEventSource";
2021-07-28 02:51:07 +02:00
new LocationInput({
centerLocation: new UIEventSource<Loc>({
lat: 51.1110,
lon: 3.3701,
zoom : 14
})
}).SetStyle("height: 500px")
2021-09-29 19:49:42 +02:00
.AttachTo("maindiv");
>>>>>>> feature/animated-precise-input