Fix bug in bounds calculation for negative lats/lons

This commit is contained in:
Pieter Vander Vennet 2021-09-27 15:38:12 +02:00
parent 215aebce19
commit 38037014b0
6 changed files with 65 additions and 51 deletions

61
test.ts
View file

@ -5,46 +5,29 @@ import MinimapImplementation from "./UI/Base/MinimapImplementation";
import {UIEventSource} from "./Logic/UIEventSource";
import FilteredLayer from "./Models/FilteredLayer";
import {And} from "./Logic/Tags/And";
import ShowDataLayer from "./UI/ShowDataLayer/ShowDataLayer";
import ShowTileInfo from "./UI/ShowDataLayer/ShowTileInfo";
import StaticFeatureSource from "./Logic/FeatureSource/Sources/StaticFeatureSource";
import {BBox} from "./Logic/GeoOperations";
import Minimap from "./UI/Base/Minimap";
const layout = AllKnownLayouts.allKnownLayouts.get("cyclestreets")
State.state = new State(layout)
State.state = new State(undefined)
const leafletMap = new UIEventSource(undefined)
MinimapImplementation.initialize()
const feature = {
"type": "Feature",
"properties": {
id: "way/1234",
"highway":"residential",
"cyclestreet":"yes"
},
"geometry": {
"type": "LineString",
"coordinates": [
[
3.2207107543945312,
51.21978729870313
],
[
3.2198524475097656,
51.21899435057332
],
[
3.2155394554138184,
51.21617188199714
]
]
}
}
Minimap.createMiniMap({
leafletMap: leafletMap,
}).SetStyle("height: 600px; width: 600px")
.AttachTo("maindiv")
State.state.allElements.addOrGetElement(feature)
State.state.filteredLayers = new UIEventSource<FilteredLayer[]>(
layout.layers.map( l => ({
layerDef :l,
appliedFilters: new UIEventSource<And>(undefined),
isDisplayed: new UIEventSource<boolean>(undefined)
}))
)
const bbox = BBox.fromTile(16,32754,21785).asGeoJson({
count: 42,
tileId: 42
})
const splitroad = new SplitRoadWizard("way/1234")
splitroad.AttachTo("maindiv")
splitroad.dialogIsOpened.setData(true)
console.log(bbox)
new ShowDataLayer({
layerToShow: ShowTileInfo.styling,
leafletMap: leafletMap,
features: new StaticFeatureSource([ bbox], false)
})