Skip to content

Commit

Permalink
Begroeide i.p.v begroeid en preview bestuurlijke gebieden nu productie
Browse files Browse the repository at this point in the history
  • Loading branch information
JLSchaap committed Mar 11, 2024
1 parent f9fa051 commit 6586c78
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h3>Vectortile Demo Viewer</h3>
>{{ demotextVisualisatie }}
</mat-slide-toggle>

<mat-slide-toggle
<!--mat-slide-toggle
class="check"
labelPosition="before"
[matTooltip]="'preview features'"
Expand All @@ -39,6 +39,6 @@ <h3>Vectortile Demo Viewer</h3>
[checked]="isPreviewFeature"
(click)="DemoPreviewFeaturesToggle()"
>Toon preview features
</mat-slide-toggle>
</mat-slide-toggle-->
</div>
</div>
75 changes: 38 additions & 37 deletions projects/vectortile-demo/src/app/demobox/demobox.component.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Component, EventEmitter, Output } from '@angular/core';
import { View } from 'ol';
import { demoSettings } from '../app.component';
import { Visualisatie, getRandomEnumValue } from '../enumVisualisatie';
import { LocationService } from '../location.service';
import { Component, EventEmitter, Output } from '@angular/core'
import { View } from 'ol'
import { demoSettings } from '../app.component'
import { Visualisatie, getRandomEnumValue } from '../enumVisualisatie'
import { LocationService } from '../location.service'

@Component({
selector: 'app-demobox',
Expand All @@ -21,90 +21,91 @@ export class DemoboxComponent {
demotextVisualisatie = this.demotextVisualisatieAan;

public get isDemoVisualisatieRotate(): boolean {
return demoSettings.demoVisualisatieRotate;
return demoSettings.demoVisualisatieRotate
}
public set isDemoVisualisatieRotate(value: boolean) {
demoSettings.demoVisualisatieRotate = value;
demoSettings.demoVisualisatieRotate = value
}

public get isDemoLocatieRotate(): boolean {
return demoSettings.demoLocatieRotate;
return demoSettings.demoLocatieRotate
}
public set isDemoLocatieRotate(value: boolean) {
demoSettings.demoLocatieRotate = value;
demoSettings.demoLocatieRotate = value
}

public get isPreviewFeature(): boolean {
return demoSettings.previewFeature;
return demoSettings.previewFeature

}
public set isPreviewFeature(value: boolean) {
demoSettings.previewFeature = value;
demoSettings.previewFeature = value
}

constructor(private locationService: LocationService) {}
constructor(private locationService: LocationService) { }
ngOnInit(): void {
this.locationService.currentLocation.subscribe((currentLocation) => {
// this.currentlocation = currentLocation;
});
})
}

DemoPreviewFeaturesToggle() {
this.isPreviewFeature = !this.isPreviewFeature;
this.isPreviewFeature = !this.isPreviewFeature
}

DemoRandomLocationToggle() {
this.isDemoLocatieRotate = !this.isDemoLocatieRotate;
this.isDemoLocatieRotate = !this.isDemoLocatieRotate
if (this.isDemoLocatieRotate) {
this.demotextLocatie = this.demotextLocatieUit;
this.gotoRandomLocation();
this.demotextLocatie = this.demotextLocatieUit
this.gotoRandomLocation()
} else {
this.demotextLocatie = this.demotextLocatieAan;
this.demotextLocatie = this.demotextLocatieAan
}
}

DemogotoStartLocationOnMap() {
this.visEmit.emit(Visualisatie.BGTstandaard);
this.isDemoVisualisatieRotate = false;
this.isDemoLocatieRotate = false;
const newloc = this.locationService.initialView;
this.locationService.changeView(newloc);
this.visEmit.emit(Visualisatie.BGTstandaard)
this.isDemoVisualisatieRotate = false
this.isDemoLocatieRotate = false
const newloc = this.locationService.initialView
this.locationService.changeView(newloc)
}

DemoVisualisationToggle() {
this.isDemoVisualisatieRotate = !this.isDemoVisualisatieRotate;
this.isDemoVisualisatieRotate = !this.isDemoVisualisatieRotate
if (this.isDemoVisualisatieRotate) {
this.demotextVisualisatie = this.demotextVisualisatieUit;
this.demotextVisualisatie = this.demotextVisualisatieUit

this.visEmit.emit(Visualisatie.BGTstandaard);
this.repeating_style_function();
this.visEmit.emit(Visualisatie.BGTstandaard)
this.repeating_style_function()
} else {
this.demotextVisualisatie = this.demotextVisualisatieAan;
this.demotextVisualisatie = this.demotextVisualisatieAan
}
}

gotoRandomLocation() {
if (this.isDemoLocatieRotate) {
const dx = 155000 + Math.round(Math.random() * 50000);
const dy = 463000 + Math.round(Math.random() * 50000);
const dx = 155000 + Math.round(Math.random() * 50000)
const dy = 463000 + Math.round(Math.random() * 50000)
const newloc = new View({
projection: this.locationService.rdProjection,
center: [dx, dy],
zoom: 13,
enableRotation: false,
});
this.locationService.changeView(newloc);
})
this.locationService.changeView(newloc)
setTimeout(() => {
this.gotoRandomLocation();
}, 8000);
this.gotoRandomLocation()
}, 8000)
}
}

repeating_style_function() {
if (this.isDemoVisualisatieRotate) {
this.visEmit.emit(getRandomEnumValue(Visualisatie));
this.visEmit.emit(getRandomEnumValue(Visualisatie))
setTimeout(() => {
this.repeating_style_function();
}, Math.round(Math.random() * 4000));
this.repeating_style_function()
}, Math.round(Math.random() * 4000))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ function getCollection(layer: string): string {
layer = layer.replace("deel", "delen")
layer = layer.replace("label", "labels")
layer = layer.replace("aanduiding", "aanduidingen")
layer = layer.replace("begroeid", "begroeide")

switch (layer) {
case "pand": {
Expand All @@ -136,6 +137,7 @@ function getCollection(layer: string): string {




default: {
return layer

Expand Down

0 comments on commit 6586c78

Please sign in to comment.