diff options
author | Aijana Schumann <aijana.schumann@highstreet-technologies.com> | 2020-10-09 21:08:54 +0200 |
---|---|---|
committer | Aijana Schumann <aijana.schumann@highstreet-technologies.com> | 2020-10-09 21:08:54 +0200 |
commit | f8196fc099fd35947d3903051ad543aa3cefccbb (patch) | |
tree | 67fc5cc856b5e38379e88a33939e3d730aa720c3 /sdnr/wt/odlux/apps/networkMapApp/src/utils/mapUtils.ts | |
parent | 0f280166f426fe313dd333f7fe78ad4c6cac62b6 (diff) |
Networkmap bugfix
Fix icons don't show up after reload
Issue-ID: CCSDK-2879
Signed-off-by: Aijana Schumann <aijana.schumann@highstreet-technologies.com>
Change-Id: Ic752d969acb0985e4ae97cec101ac2bbe0895716
Diffstat (limited to 'sdnr/wt/odlux/apps/networkMapApp/src/utils/mapUtils.ts')
-rw-r--r-- | sdnr/wt/odlux/apps/networkMapApp/src/utils/mapUtils.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sdnr/wt/odlux/apps/networkMapApp/src/utils/mapUtils.ts b/sdnr/wt/odlux/apps/networkMapApp/src/utils/mapUtils.ts index 34cdc0638..da3e97ee3 100644 --- a/sdnr/wt/odlux/apps/networkMapApp/src/utils/mapUtils.ts +++ b/sdnr/wt/odlux/apps/networkMapApp/src/utils/mapUtils.ts @@ -21,6 +21,17 @@ const EARTHRADIUSM = 6378137; type updatedCoordinates = { south: number, west: number, north: number, east: number }; +export const increaseBoundingBox = (map: mapboxgl.Map) =>{ + + const bbox = map.getBounds(); + + const distance = map.getCenter().distanceTo(bbox.getNorthEast()); // radius of visible area (center -> corner) (in meters) + + //calculate new boundingBox + const increasedBoundingBox = addDistance(bbox.getSouth(), bbox.getWest(), bbox.getNorth(), bbox.getEast(), (distance / 1000) / 2); + return increasedBoundingBox; +} + export const addDistance = (south: number, west: number, north: number, east: number, distanceKm: number): updatedCoordinates => { |