This commit is contained in:
parent
5479be90b8
commit
230dddbfd6
3 changed files with 204 additions and 235 deletions
|
@ -40,7 +40,7 @@
|
||||||
"@angular/platform-server": "^18.2.13",
|
"@angular/platform-server": "^18.2.13",
|
||||||
"@angular/router": "^18.2.13",
|
"@angular/router": "^18.2.13",
|
||||||
"@mapbox/point-geometry": "^0.1.0",
|
"@mapbox/point-geometry": "^0.1.0",
|
||||||
"@maplibre/ngx-maplibre-gl": "^17.4.3",
|
"@maplibre/ngx-maplibre-gl": "^18.1.4",
|
||||||
"@turf/bbox": "^7.1.0",
|
"@turf/bbox": "^7.1.0",
|
||||||
"@turf/distance": "^7.1.0",
|
"@turf/distance": "^7.1.0",
|
||||||
"@turf/helpers": "^7.1.0",
|
"@turf/helpers": "^7.1.0",
|
||||||
|
|
421
pnpm-lock.yaml
generated
421
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,4 @@
|
||||||
import { ElementRef, Input, ViewChild, Directive, HostListener } from '@angular/core'
|
import { ElementRef, Input, ViewChild, Directive, HostListener, OutputRefSubscription } from '@angular/core'
|
||||||
|
|
||||||
import { Subscription } from 'rxjs'
|
|
||||||
|
|
||||||
import { MatButton } from '@angular/material/button'
|
import { MatButton } from '@angular/material/button'
|
||||||
|
|
||||||
|
@ -41,13 +39,13 @@ export class GisafRulerDirective {
|
||||||
@Input() secondaryColor: string = 'white'
|
@Input() secondaryColor: string = 'white'
|
||||||
@Input() fontHalo: number = 2
|
@Input() fontHalo: number = 2
|
||||||
@ViewChild(MatButton) button: MatButton
|
@ViewChild(MatButton) button: MatButton
|
||||||
clickSubscription: Subscription
|
clickSubscription: OutputRefSubscription
|
||||||
lineDrawn: boolean
|
lineDrawn: boolean
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public elementRef: ElementRef,
|
public elementRef: ElementRef,
|
||||||
private mapService: MapService
|
private mapService: MapService
|
||||||
) {}
|
) { }
|
||||||
|
|
||||||
@HostListener('click')
|
@HostListener('click')
|
||||||
onClick() {
|
onClick() {
|
||||||
|
@ -103,7 +101,7 @@ export class GisafRulerDirective {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
labelFormat(n) {
|
labelFormat(n) {
|
||||||
return n == 0 ? '0' : n < 1 ? `${(n * 1000).toFixed(2)} m`: `${n.toFixed(3)} km`
|
return n == 0 ? '0' : n < 1 ? `${(n * 1000).toFixed(2)} m` : `${n.toFixed(3)} km`
|
||||||
}
|
}
|
||||||
|
|
||||||
onMapClick(evt: MapMouseEvent) {
|
onMapClick(evt: MapMouseEvent) {
|
||||||
|
@ -149,9 +147,9 @@ export class GisafRulerDirective {
|
||||||
addLayers() {
|
addLayers() {
|
||||||
const map = this.mapService.mapInstance
|
const map = this.mapService.mapInstance
|
||||||
map.addSource(SOURCE_LINE, {
|
map.addSource(SOURCE_LINE, {
|
||||||
type: 'geojson',
|
type: 'geojson',
|
||||||
data: this.getLineStringFeatures()
|
data: this.getLineStringFeatures()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
map.addSource(SOURCE_SYMBOL, {
|
map.addSource(SOURCE_SYMBOL, {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue