summaryrefslogtreecommitdiff
path: root/src/scripts/controllers/scaleindicator.ts
diff options
context:
space:
mode:
authorGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-23 09:48:38 +0200
committerGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-23 09:48:38 +0200
commit09596c3c5a6a2a44675f170106bb38746229e02a (patch)
tree763d1b710dc5f2fcab920ac6ab2c555cee4d6342 /src/scripts/controllers/scaleindicator.ts
parent057952b0bacc6e963c74bb1bbebbcccd6174a75c (diff)
Remove old frontend
Diffstat (limited to 'src/scripts/controllers/scaleindicator.ts')
-rw-r--r--src/scripts/controllers/scaleindicator.ts45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/scripts/controllers/scaleindicator.ts b/src/scripts/controllers/scaleindicator.ts
deleted file mode 100644
index 789f2cc7..00000000
--- a/src/scripts/controllers/scaleindicator.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-import {MapController, CELL_SIZE} from "./mapcontroller";
-import {MapView} from "../views/mapview";
-
-
-export class ScaleIndicatorController {
- private static MIN_WIDTH = 50;
- private static MAX_WIDTH = 100;
-
- private mapController: MapController;
- private mapView: MapView;
-
- private jqueryObject: JQuery;
- private currentDivisor: number;
-
-
- constructor(mapController: MapController) {
- this.mapController = mapController;
- this.mapView = mapController.mapView;
- }
-
- public init(jqueryObject: JQuery): void {
- this.jqueryObject = jqueryObject;
- this.currentDivisor = 1;
- }
-
- public update(): void {
- const currentZoom = this.mapView.mapContainer.scaleX;
- let newWidth;
- do {
- newWidth = (currentZoom * CELL_SIZE) / this.currentDivisor;
-
- if (newWidth < ScaleIndicatorController.MIN_WIDTH) {
- this.currentDivisor /= 2;
- } else if (newWidth > ScaleIndicatorController.MAX_WIDTH) {
- this.currentDivisor *= 2;
- } else {
- break;
- }
- } while (true);
-
-
- this.jqueryObject.text(MapView.CELL_SIZE_METERS / this.currentDivisor + "m");
- this.jqueryObject.width(newWidth);
- }
-}