Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
MAPSJS-2660: BoundsGenerator cleanup.
Browse files Browse the repository at this point in the history
- Move sphere view bounds and planar view bounds generation to separate
classes.
- Change interface to avoid having to change projection and wrapping
 both in MapView and BoundsGenerator.

Signed-off-by: Andres Mandado <andres.mandado-almajano@here.com>
  • Loading branch information
atomicsulfate committed Aug 27, 2021
1 parent cdb3d50 commit a417725
Show file tree
Hide file tree
Showing 6 changed files with 680 additions and 600 deletions.
9 changes: 2 additions & 7 deletions @here/harp-examples/src/bounds-generation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,7 @@ export namespace BoundsExample {

addVectorTileDataSource(map);
const featuresDataSource = addFeaturesDataSource(map, []);
const boundsGenerator = new BoundsGenerator(
map.camera,
map.projection,
map.tileWrappingEnabled
);
const boundsGenerator = new BoundsGenerator(map);

let bounds: GeoPolygon | undefined;
let showBoundingBox: boolean = false;
Expand All @@ -159,7 +155,7 @@ export namespace BoundsExample {
map.lookAt({ bounds });
break;
case "p":
boundsGenerator.projection = map.projection =
map.projection =
map.projection === mercatorProjection
? sphereProjection
: mercatorProjection;
Expand Down Expand Up @@ -192,7 +188,6 @@ export namespace BoundsExample {
break;
case "w":
mapView.tileWrappingEnabled = !mapView.tileWrappingEnabled;
boundsGenerator.tileWrappingEnabled = mapView.tileWrappingEnabled;
mapView.update();
break;
default:
Expand Down
Loading

0 comments on commit a417725

Please sign in to comment.