@theseam/ui-common 0.3.5 → 0.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/breadcrumbs/_breadcrumbs-theme.scss +3 -3
  2. package/breadcrumbs/breadcrumbs/breadcrumbs.component.scss +10 -10
  3. package/bundles/theseam-ui-common-dynamic.umd.js +1 -1
  4. package/bundles/theseam-ui-common-dynamic.umd.js.map +1 -1
  5. package/bundles/theseam-ui-common-google-maps.umd.js +39 -7
  6. package/bundles/theseam-ui-common-google-maps.umd.js.map +1 -1
  7. package/bundles/theseam-ui-common-utils.umd.js +83 -5
  8. package/bundles/theseam-ui-common-utils.umd.js.map +1 -1
  9. package/esm2015/dynamic/evaluators/jexl-evaluator/jexl-evaluator.js +2 -2
  10. package/esm2015/google-maps/google-maps-feature-helpers.js +12 -3
  11. package/esm2015/google-maps/google-maps-places-autocomplete/google-maps-places-autocomplete.component.js +2 -2
  12. package/esm2015/google-maps/google-maps-places-autocomplete/google-maps-places-autocomplete.directive.js +1 -1
  13. package/esm2015/google-maps/google-maps.service.js +15 -5
  14. package/esm2015/utils/geo-json/coerce-feature-collection.js +1 -1
  15. package/esm2015/utils/geo-json/geo-json-to-area.js +1 -1
  16. package/esm2015/utils/geo-json/is-feature-collection.validator.js +1 -1
  17. package/esm2015/utils/geo-json/is-only-geometry-types.js +1 -1
  18. package/esm2015/utils/geo-json/is-only-geometry-types.validator.js +1 -1
  19. package/esm2015/utils/geo-json/merge-polygons.js +1 -1
  20. package/esm2015/utils/geo-json/min-max-points.validator.js +56 -0
  21. package/esm2015/utils/geo-json/no-inner-rings.validator.js +1 -1
  22. package/esm2015/utils/geo-json/no-kinks.validator.js +2 -2
  23. package/esm2015/utils/geo-json/split-multi-polygons.js +1 -1
  24. package/esm2015/utils/public-api.js +2 -1
  25. package/fesm2015/theseam-ui-common-dynamic.js +1 -1
  26. package/fesm2015/theseam-ui-common-dynamic.js.map +1 -1
  27. package/fesm2015/theseam-ui-common-google-maps.js +26 -7
  28. package/fesm2015/theseam-ui-common-google-maps.js.map +1 -1
  29. package/fesm2015/theseam-ui-common-utils.js +59 -6
  30. package/fesm2015/theseam-ui-common-utils.js.map +1 -1
  31. package/framework/top-bar/_top-bar-theme.scss +5 -5
  32. package/google-maps/google-maps-feature-helpers.d.ts +1 -0
  33. package/google-maps/theseam-ui-common-google-maps.metadata.json +1 -1
  34. package/package.json +1 -1
  35. package/utils/geo-json/min-max-points.validator.d.ts +3 -0
  36. package/utils/public-api.d.ts +1 -0
  37. package/utils/theseam-ui-common-utils.metadata.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"theseam-ui-common-google-maps.js","sources":["../../../projects/ui-common/google-maps/google-maps-feature-helpers.ts","../../../projects/ui-common/google-maps/google-maps-contextmenu.ts","../../../projects/ui-common/google-maps/map-value-manager.service.ts","../../../projects/ui-common/google-maps/google-maps.service.ts","../../../projects/ui-common/google-maps/map-controls-service.ts","../../../projects/ui-common/google-maps/google-maps-controls.service.ts","../../../projects/ui-common/google-maps/google-maps-recenter-button-control/google-maps-recenter-button-control.component.ts","../../../projects/ui-common/google-maps/google-maps-upload-button-control/google-maps-upload-button-control.component.ts","../../../projects/ui-common/google-maps/google-maps/google-maps.component.ts","../../../projects/ui-common/google-maps/google-maps-places-autocomplete/google-maps-places-autocomplete.directive.ts","../../../projects/ui-common/google-maps/google-maps-places-autocomplete/google-maps-places-autocomplete.component.ts","../../../projects/ui-common/google-maps/map-control.component.ts","../../../projects/ui-common/google-maps/map-file-drop/map-file-drop.component.ts","../../../projects/ui-common/google-maps/google-maps.module.ts","../../../projects/ui-common/google-maps/theseam-ui-common-google-maps.ts"],"sourcesContent":["import { coerceBooleanProperty } from '@angular/cdk/coercion'\nimport { NgZone } from '@angular/core'\nimport { Observable } from 'rxjs'\n\nimport { notNullOrUndefined } from '@theseam/ui-common/utils'\nimport booleanContains from '@turf/boolean-contains'\nimport {\n multiPolygon as turfjsMultiPolygon,\n polygon as turfjsPolygon,\n} from '@turf/helpers'\n\nexport enum AppFeaturePropertyName {\n IsSelected = `__app__isSelected`\n}\n\nexport function isAppFeatureProperty(propertyName: string): propertyName is AppFeaturePropertyName {\n return Object.values(AppFeaturePropertyName)\n .findIndex(value => value === propertyName) !== -1\n}\n\nexport function isFeatureSelected(feature: google.maps.Data.Feature): boolean {\n const isSelected = feature.getProperty(AppFeaturePropertyName.IsSelected)\n return coerceBooleanProperty(isSelected)\n}\n\nexport function setFeatureSelected(feature: google.maps.Data.Feature, isSelected: boolean): void {\n feature.setProperty(AppFeaturePropertyName.IsSelected, isSelected)\n}\n\n// TODO: Check performance of cloning a google.maps.Data instance, so the\n// properties can be removed with the google maps api, instead of on the\n// resulting json.\nexport function stripAppFeaturePropertiesFromJson(json: any) {\n if (notNullOrUndefined(json) && Array.isArray(json?.features)) {\n for (const feature of json.features) {\n if (notNullOrUndefined(feature?.properties)) {\n for (const k of Object.keys(feature.properties)) {\n if (isAppFeatureProperty(k)) {\n feature.properties[k] = undefined\n delete feature.properties[k]\n }\n }\n }\n }\n }\n}\n\n/**\n * Searches for a Feature in Data that contains the provided Feature and can use\n * it as a cutout area.\n */\nexport function getPossibleExteriorFeature(\n data: google.maps.Data,\n feature: google.maps.Data.Feature\n): google.maps.Data.Feature | undefined {\n let exteriorPolygonFeature: google.maps.Data.Feature | undefined\n data.forEach(f => {\n if (f !== feature && (f.getGeometry().getType() === 'Polygon' && featureContains(f, feature))) {\n exteriorPolygonFeature = f\n }\n })\n return exteriorPolygonFeature\n}\n\nexport function addInnerFeatureCutoutToExteriorFeature(\n exteriorFeature: google.maps.Data.Feature,\n innerFeature: google.maps.Data.Feature\n): void {\n // NOTE: Other geometries may support cutouts, but our map shapes editor only\n // supports polygons currently, so we will need to handle other geometry types\n // here if we start allowing users to draw shapes other than polygon.\n if (exteriorFeature.getGeometry().getType() !== 'Polygon' || innerFeature.getGeometry().getType() !== 'Polygon') {\n throw Error(`Inner cutout is only supported by Polygon gemoetry.`)\n }\n\n const featurePolygon = innerFeature.getGeometry() as google.maps.Data.Polygon\n const exteriorPolygon = exteriorFeature.getGeometry() as google.maps.Data.Polygon\n exteriorFeature.setGeometry(new google.maps.Data.Polygon([\n ...exteriorPolygon.getArray(),\n featurePolygon.getAt(0).getArray().reverse()\n ]))\n}\n\n/**\n * Google maps paths don't always start and stop at the exact same position, so\n * this will fix that for turfjs.\n */\nexport function fixPathDifferentStartingAndEndingPoint(coordinates: number[][]): void {\n if (coordinates.length <= 1) {\n return\n }\n\n const start = coordinates[0]\n const end = coordinates[coordinates.length - 1]\n if (start[0] === end[0] && start[1] === end[1]) {\n return\n }\n\n coordinates.push(coordinates[0])\n}\n\nexport function polygonCoordinates(polygon: google.maps.Data.Polygon): number[][][] {\n return polygon.getArray().map(linRing => {\n const coords = linRing.getArray().map(x => [ x.lng(), x.lat() ])\n fixPathDifferentStartingAndEndingPoint(coords)\n return coords\n })\n}\n\nexport function multiPolygonCoordinates(multiPolygon: google.maps.Data.MultiPolygon): number[][][][] {\n return multiPolygon.getArray().map(x => polygonCoordinates(x))\n}\n\nexport function toTurfJsPolygon(polygon: google.maps.Data.Polygon) {\n return turfjsPolygon(polygonCoordinates(polygon))\n}\n\nexport function toTurfJsMultiPolygon(multiPolygon: google.maps.Data.MultiPolygon) {\n return turfjsMultiPolygon(multiPolygonCoordinates(multiPolygon))\n}\n\nexport function toTurfJsFeature(googleFeature: google.maps.Data.Feature) {\n if (googleFeature.getGeometry().getType() === 'Polygon') {\n return toTurfJsPolygon(googleFeature.getGeometry() as google.maps.Data.Polygon)\n } else if (googleFeature.getGeometry().getType() === 'MultiPolygon') {\n return toTurfJsMultiPolygon(googleFeature.getGeometry() as google.maps.Data.MultiPolygon)\n }\n\n throw Error(`Unexpected geometry.`)\n}\n\nexport function featureContains(featureA: google.maps.Data.Feature, featureB: google.maps.Data.Feature): boolean {\n const polygonA = toTurfJsFeature(featureA)\n const polygonB = toTurfJsFeature(featureB)\n return booleanContains(polygonA, polygonB)\n}\n\nexport function createDataFeatureFromPolygon(polygon: google.maps.Polygon): google.maps.Data.Feature {\n const arr = polygon.getPath().getArray()\n return new google.maps.Data.Feature({\n geometry: new google.maps.Data.Polygon([ arr ])\n })\n}\n\nexport function getBoundsWithAllFeatures(data: google.maps.Data): google.maps.LatLngBounds {\n const bounds = new google.maps.LatLngBounds()\n\n data.forEach(feature => {\n const geometry = feature.getGeometry()\n geometry.forEachLatLng(latLng => {\n bounds.extend(latLng)\n })\n })\n\n return bounds\n}\n\nexport function getFeatureBounds(feature: google.maps.Data.Feature): google.maps.LatLngBounds {\n const bounds = new google.maps.LatLngBounds()\n\n const geometry = feature.getGeometry()\n geometry.forEachLatLng(latLng => {\n bounds.extend(latLng)\n })\n\n return bounds\n}\n\nexport function getFeatureCenter(feature: google.maps.Data.Feature): google.maps.LatLng {\n return getFeatureBounds(feature).getCenter()\n}\n\nexport function removeAllFeatures(data: google.maps.Data): void {\n data.forEach(f => data.remove(f))\n}\n\nexport function getFeaturesCount(data: google.maps.Data): number {\n let count = 0\n data.forEach(() => count++)\n return count\n}\n\n/**\n * NOTE: Original events are not emitted, because filtering may omit events.\n */\nexport function createFeatureChangeObservable(data: google.maps.Data, ngZone: NgZone): Observable<void> {\n return new Observable<void>(subscriber => {\n const listeners: google.maps.MapsEventListener[] = []\n\n ngZone.runOutsideAngular(() => {\n listeners.push(data.addListener('setgeometry', (event: google.maps.Data.SetGeometryEvent) => {\n ngZone.run(() => { subscriber.next(undefined) })\n }))\n\n listeners.push(data.addListener('addfeature', (event: google.maps.Data.AddFeatureEvent) => {\n ngZone.run(() => { subscriber.next(undefined) })\n }))\n\n listeners.push(data.addListener('removefeature', (event: google.maps.Data.RemoveFeatureEvent) => {\n ngZone.run(() => { subscriber.next(undefined) })\n }))\n\n listeners.push(data.addListener('setproperty', (event: google.maps.Data.SetPropertyEvent) => {\n if (!isAppFeatureProperty(event.name)) {\n ngZone.run(() => { subscriber.next(undefined) })\n }\n }))\n\n listeners.push(data.addListener('removeproperty', (event: google.maps.Data.RemovePropertyEvent) => {\n if (!isAppFeatureProperty(event.name)) {\n ngZone.run(() => { subscriber.next(undefined) })\n }\n }))\n })\n\n return () => {\n listeners.forEach(google.maps.event.removeListener)\n }\n })\n}\n","import { ESCAPE } from '@angular/cdk/keycodes'\nimport { NgZone, ViewContainerRef } from '@angular/core'\nimport { fromEvent, Subject } from 'rxjs'\nimport { takeUntil } from 'rxjs/operators'\n\nimport { MenuComponent } from '@theseam/ui-common/menu'\n\nimport { isFeatureSelected } from './google-maps-feature-helpers'\n\n// TODO: Close on map losing focus.\n\nexport class GoogleMapsContextMenu {\n\n private readonly _overlayView: google.maps.OverlayView\n private readonly _cleanupFn: () => void\n\n constructor(\n private readonly _map: google.maps.Map,\n private readonly _menu: MenuComponent,\n _position: google.maps.LatLng,\n private readonly _vcr: ViewContainerRef,\n private readonly _ngZone: NgZone,\n private readonly _data: google.maps.Data,\n private readonly _feature: google.maps.Data.Feature,\n ) {\n const tplRef = this._menu.templateRef\n if (tplRef === undefined || tplRef === null) {\n throw Error(`Menu template is not defined.`)\n }\n\n const ref = this._vcr.createEmbeddedView(tplRef)\n ref.detectChanges()\n\n const listeners: google.maps.MapsEventListener[] = []\n const ngUnsubscribe = new Subject<void>()\n\n // TODO: Fix the initial focus. setTimeout avoids the wrong contextmenu\n // getting triggered, but the first item flashes and looks off this way.\n setTimeout(() => {\n this._menu.focusFirstItem('program')\n })\n this._menu.closed.pipe(\n takeUntil(ngUnsubscribe)\n ).subscribe(v => {\n this.close()\n })\n\n fromEvent(document, 'keydown').pipe(\n takeUntil(ngUnsubscribe)\n ).subscribe((event: any) => {\n if (event.keyCode === ESCAPE) {\n this.close()\n }\n })\n\n const __cleanup = () => this._cleanupFn()\n class GoogleMapsContextMenuOverlayView extends google.maps.OverlayView {\n public containerDiv: HTMLDivElement\n\n constructor(\n public position: google.maps.LatLng,\n content: HTMLElement\n ) {\n super()\n this.position = position\n\n this.containerDiv = document.createElement('div')\n this.containerDiv.style.cursor = 'auto'\n this.containerDiv.style.height = '0',\n this.containerDiv.style.position = 'absolute'\n this.containerDiv.appendChild(content)\n\n // Optionally stop clicks, etc., from bubbling up to the map.\n GoogleMapsContextMenuOverlayView.preventMapHitsAndGesturesFrom(this.containerDiv)\n }\n\n /** Called when the view is added to the map. */\n onAdd() {\n // tslint:disable-next-line: no-non-null-assertion\n this.getPanes()!.floatPane.appendChild(this.containerDiv)\n }\n\n /** Called when the view is removed from the map. */\n onRemove() {\n if (this.containerDiv.parentElement) {\n this.containerDiv.parentElement.removeChild(this.containerDiv)\n }\n __cleanup()\n }\n\n /** Called each frame when the view needs to draw itself. */\n draw() {\n // tslint:disable-next-line: no-non-null-assertion\n const divPosition = this.getProjection().fromLatLngToDivPixel(this.position)!\n\n // Hide the popup when it is far out of view.\n const display =\n Math.abs(divPosition.x) < 4000 && Math.abs(divPosition.y) < 4000\n ? 'block'\n : 'none'\n\n if (display === 'block') {\n this.containerDiv.style.left = divPosition.x + 'px'\n this.containerDiv.style.top = divPosition.y + 'px'\n }\n\n if (this.containerDiv.style.display !== display) {\n this.containerDiv.style.display = display\n }\n }\n }\n\n this._overlayView = new GoogleMapsContextMenuOverlayView(_position, ref.rootNodes[0])\n this._overlayView.setMap(this._map)\n\n this._ngZone.runOutsideAngular(() => {\n listeners.push(this._data.addListener('removefeature', (event: google.maps.Data.RemoveFeatureEvent) => {\n if (event.feature === this._feature) {\n this._ngZone.run(() => { this.close() })\n }\n }))\n\n listeners.push(this._data.addListener('setproperty', (event: google.maps.Data.SetPropertyEvent) => {\n if (event.feature === this._feature && !isFeatureSelected(this._feature)) {\n this._ngZone.run(() => { this.close() })\n }\n }))\n\n listeners.push(this._data.addListener('removeproperty', (event: google.maps.Data.RemovePropertyEvent) => {\n if (event.feature === this._feature && !isFeatureSelected(this._feature)) {\n this._ngZone.run(() => { this.close() })\n }\n }))\n\n listeners.push(this._map.addListener('click', (event: google.maps.MapMouseEvent | google.maps.IconMouseEvent) => {\n this._ngZone.run(() => { this.close() })\n }))\n\n listeners.push(this._data.addListener('click', (event: google.maps.Data.MouseEvent) => {\n this._ngZone.run(() => { this.close() })\n }))\n })\n\n this._cleanupFn = () => {\n ngUnsubscribe.next()\n ngUnsubscribe.complete()\n listeners.forEach(google.maps.event.removeListener)\n }\n }\n\n public close(): void {\n this._overlayView.setMap(null)\n }\n\n}\n","import { Injectable } from '@angular/core'\nimport { Observable, Subject } from 'rxjs'\n\nexport enum MapValueSource {\n Input = 'input',\n FeatureChange = 'featurechange'\n}\n\nexport type MapValue = object | undefined | null\n\nexport interface MapValueChange {\n value: MapValue\n source: MapValueSource\n}\n\n@Injectable()\nexport class MapValueManagerService {\n\n private readonly _valueChangedSubject = new Subject<MapValueChange>()\n\n private _value: MapValue\n\n public readonly valueChanged: Observable<MapValueChange>\n\n constructor() {\n this.valueChanged = this._valueChangedSubject.asObservable()\n }\n\n public setValue(value: MapValue, source: MapValueSource): boolean {\n if (value === this._value) {\n return false\n }\n\n if (value === null || value === undefined) {\n this._value = value\n const _change: MapValueChange = {\n source,\n value: this._value,\n }\n this._valueChangedSubject.next(_change)\n return true\n }\n\n if (JSON.stringify(value) === JSON.stringify(this._value)) {\n return true\n }\n\n // TODO: Validate object is valid geojson.\n this._value = value\n const change: MapValueChange = {\n source,\n value: this._value,\n }\n this._valueChangedSubject.next(change)\n return true\n }\n\n public get value(): MapValue {\n return this._value\n }\n\n}\n","import { Injectable, NgZone, OnDestroy, ViewContainerRef } from '@angular/core'\nimport { BehaviorSubject, from, Observable, Subject } from 'rxjs'\nimport { switchMap, takeUntil, tap } from 'rxjs/operators'\n\nimport { MenuComponent } from '@theseam/ui-common/menu'\nimport { isNullOrUndefined, notNullOrUndefined } from '@theseam/ui-common/utils'\n\nimport { GoogleMapsContextMenu } from './google-maps-contextmenu'\nimport {\n addInnerFeatureCutoutToExteriorFeature,\n createDataFeatureFromPolygon,\n createFeatureChangeObservable,\n getBoundsWithAllFeatures,\n getFeatureCenter,\n getFeaturesCount,\n getPossibleExteriorFeature,\n isFeatureSelected,\n removeAllFeatures,\n setFeatureSelected,\n stripAppFeaturePropertiesFromJson,\n} from './google-maps-feature-helpers'\nimport { MapValueManagerService, MapValueSource } from './map-value-manager.service'\n\ndeclare const ngDevMode: boolean | undefined\n\nconst DEFAULT_POLYGON_OPTIONS: google.maps.PolygonOptions = {\n clickable: true,\n draggable: true,\n editable: true,\n // fillColor: 'rgba(60,150,60,1)',\n // strokeColor: 'rgba(155,255,0,1)'\n}\n\nconst DEFAULT_DRAWING_MANAGER_OPTIONS: (() => google.maps.drawing.DrawingManagerOptions) = () => ({\n drawingControl: true,\n drawingControlOptions: {\n drawingModes: [\n google.maps.drawing.OverlayType.POLYGON\n ]\n },\n polygonOptions: DEFAULT_POLYGON_OPTIONS,\n drawingMode: null\n})\n\nconst FEATURE_STYLE_OPTIONS_DEFAULT: google.maps.Data.StyleOptions = {\n clickable: true,\n visible: true,\n // zIndex?: number;\n\n // cursor?: string;\n draggable: false,\n editable: false,\n fillColor: 'teal',\n fillOpacity: 0.3,\n strokeColor: 'blue',\n strokeOpacity: 1,\n strokeWeight: 2,\n}\n\nconst FEATURE_STYLE_OPTIONS_SELECTED: google.maps.Data.StyleOptions = {\n ...FEATURE_STYLE_OPTIONS_DEFAULT,\n draggable: true,\n editable: true,\n fillColor: 'green',\n fillOpacity: 0.7,\n strokeColor: 'limegreen',\n strokeOpacity: 1,\n strokeWeight: 2,\n}\n\ntype WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] }\n\n@Injectable()\nexport class GoogleMapsService implements OnDestroy {\n private readonly _ngUnsubscribe = new Subject<void>()\n\n private readonly _mapReadySubject = new BehaviorSubject<boolean>(false)\n\n private _drawingManager?: google.maps.drawing.DrawingManager\n private _featureContextMenu: MenuComponent | null = null\n private _activeContextMenu: GoogleMapsContextMenu | null = null\n private _baseLatLng?: google.maps.LatLngLiteral\n\n private _allowDrawingHoleInPolygon: boolean = false\n\n // TODO: Move to a better place than the map wrapper service.\n private _fileInputHandler: ((file: File) => void) | undefined | null\n\n public googleMap?: google.maps.Map\n\n public readonly mapReady$: Observable<boolean>\n\n public get mapReady(): boolean { return this._mapReadySubject.value }\n\n constructor(\n private readonly _mapValueManager: MapValueManagerService,\n private readonly _ngZone: NgZone,\n private readonly _vcr: ViewContainerRef,\n ) {\n this.mapReady$ = this._mapReadySubject.asObservable()\n }\n\n ngOnDestroy(): void {\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n\n public setMap(map: google.maps.Map): void {\n this.googleMap = map\n this._mapReadySubject.next(true)\n this._initDrawingManager()\n this._initFeatureStyling()\n this._initFeatureChangeListeners()\n }\n\n public setBaseLatLng(lat: number, lng: number): void {\n this._baseLatLng = { lat, lng }\n }\n\n // TODO: Refactor out of the service meant to just wrap the google maps api.\n public setFeatureContextMenu(menu: MenuComponent | null): void {\n this._featureContextMenu = menu\n }\n\n public getDiv(): HTMLDivElement {\n this._assertInitialized()\n return this.googleMap.getDiv() as HTMLDivElement\n }\n\n public fitBounds(bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral, padding?: number | google.maps.Padding): void {\n this._assertInitialized()\n this.googleMap.fitBounds(bounds, padding)\n }\n\n /**\n * Iterates the map's features and removes any that are selected.\n */\n public deleteSelection(): void {\n this._assertInitialized()\n const mapData = this.googleMap.data\n mapData.forEach(f => {\n if (isFeatureSelected(f)) {\n mapData.remove(f)\n }\n })\n }\n\n /**\n * Stops the current drawing.\n */\n public stopDrawing(): void {\n this._ngZone.runOutsideAngular(() => {\n if (isNullOrUndefined(this._drawingManager) || this._drawingManager.getDrawingMode() === null) {\n return\n }\n\n // Listening for the completion event of the overlay currently being drawn\n // and removing it. I haven't found a way to cancel the current drawing,\n // without this hack that assumes our listeners will not run into a race\n // condition.\n const listener = google.maps.event.addListener(\n this._drawingManager,\n 'overlaycomplete',\n (event: google.maps.drawing.OverlayCompleteEvent) => {\n event.overlay.setMap(null)\n listener.remove()\n }\n )\n\n // To fake canceling the current drawing, without disabling the drawing\n // mode, the drawin mode is being unset then immediately set back. When\n // the mode is unset the 'overlaycomplete' event will fire, which will\n // give a reference to the current overlay to remove, then it is set back\n // to the mode the user was using. To the user is should just seem like\n // the current drawing was canceled and they can start drawing again.\n const mode = this._drawingManager.getDrawingMode()\n this._drawingManager.setDrawingMode(null)\n this._drawingManager.setDrawingMode(mode)\n\n // 'overlaycomplete' should fire immediately, unless an overlay hadn't\n // started drawing. This timeout will make sure the listener gets removed.\n setTimeout(() => {\n listener.remove()\n })\n\n })\n }\n\n private _initDrawingManager(): void {\n if (notNullOrUndefined(this._drawingManager)) {\n throw Error(`DrawingManager is already initialized.`)\n }\n\n this._assertInitialized()\n\n const options = DEFAULT_DRAWING_MANAGER_OPTIONS()\n\n const drawingManager = new google.maps.drawing.DrawingManager(options)\n drawingManager.setMap(this.googleMap)\n\n this._drawingManager = drawingManager\n\n this._drawingManager.addListener('drawingmode_changed', event => {\n if (this._drawingManager?.getDrawingMode() !== null) {\n this._assertInitialized()\n this.googleMap.data.forEach(f => {\n if (isFeatureSelected(f)) {\n setFeatureSelected(f, false)\n }\n })\n }\n })\n }\n\n public addControl(element: HTMLElement, position: google.maps.ControlPosition): void {\n this._assertInitialized()\n this.googleMap.controls[position].push(element)\n }\n\n public async setData(data: any): Promise<void> {\n this._assertInitialized()\n removeAllFeatures(this.googleMap.data)\n this.googleMap.data.addGeoJson(data)\n this.googleMap.fitBounds(getBoundsWithAllFeatures(this.googleMap.data))\n }\n\n // TODO: Refactor out of the service meant to just wrap the google maps api.\n public reCenterOnFeatures(): void {\n this._assertInitialized()\n if (getFeaturesCount(this.googleMap.data) === 0) {\n if (!this._baseLatLng) {\n return\n }\n\n this.googleMap.panTo(this._baseLatLng)\n return\n }\n this.googleMap.fitBounds(getBoundsWithAllFeatures(this.googleMap.data))\n\n // TODO: Fix to pan to center. Currently fitBounds results in the expected\n // result, but pantToBounds animates.\n // this.googleMap.panToBounds(getBoundsWithAllFeatures(this.googleMap.data))\n }\n\n public allowDrawingHoleInPolygon(allow: boolean): void {\n this._allowDrawingHoleInPolygon = allow\n }\n\n public setFileInputHandler(handler: ((file: File) => void) | undefined | null): void {\n this._fileInputHandler\n }\n\n public getFileInputHandler(): ((file: File) => void) | undefined | null {\n return this._fileInputHandler\n }\n\n private _initFeatureStyling(): void {\n this._assertInitialized()\n\n // Disable any selection when clicking the map.\n //\n // TODO: There may be a better way to do this that would be more accurate or\n // additional events that should be listened to, such as the disabling\n // selection when the map looses focus.\n this.googleMap.addListener('click', (even: google.maps.MapMouseEvent | google.maps.IconMouseEvent) => {\n this._assertInitialized()\n this.googleMap.data.forEach(f => setFeatureSelected(f, false))\n })\n\n // Determine what the style of the features are.\n this.googleMap.data.setStyle((feature) => {\n if (isFeatureSelected(feature)) {\n return FEATURE_STYLE_OPTIONS_SELECTED\n }\n\n return FEATURE_STYLE_OPTIONS_DEFAULT\n })\n\n // Select a feature when clicked.\n this.googleMap.data.addListener('click', (event: google.maps.Data.MouseEvent) => {\n this._assertInitialized()\n\n setFeatureSelected(event.feature, true)\n this.googleMap.data.forEach(f => {\n if (f !== event.feature && isFeatureSelected(f)) {\n setFeatureSelected(f, false)\n }\n })\n })\n\n // Set a style on hovered features that can be selected.\n this.googleMap.data.addListener('mouseover', (event: google.maps.Data.MouseEvent) => {\n this._assertInitialized()\n this.googleMap.data.revertStyle()\n if (!this.isDrawing() && !isFeatureSelected(event.feature)) {\n this.googleMap.data.overrideStyle(event.feature, { strokeWeight: 4 })\n }\n })\n\n // Remove any hover styles when mouse moves away.\n this.googleMap.data.addListener('mouseout', (event: google.maps.Data.MouseEvent) => {\n this._assertInitialized()\n this.googleMap.data.revertStyle()\n })\n }\n\n private _initFeatureChangeListeners(): void {\n this._assertInitialized()\n\n createFeatureChangeObservable(this.googleMap.data, this._ngZone).pipe(\n switchMap(() => from(this.getGeoJson()).pipe(\n tap(geoJson => this._mapValueManager.setValue(geoJson, MapValueSource.FeatureChange)),\n )),\n takeUntil(this._ngUnsubscribe),\n ).subscribe()\n\n this.googleMap.data.addListener('contextmenu', (event: google.maps.Data.MouseEvent) => {\n if (!isFeatureSelected(event.feature)) {\n return\n }\n\n this._openContextMenuForFeature(event.feature, event.latLng)\n })\n\n if (notNullOrUndefined(this._drawingManager)) {\n google.maps.event.addListener(this._drawingManager, 'polygoncomplete', (polygon: google.maps.Polygon) => {\n // The DrawingManager doesn't seem to have a way to access the overlays,\n // so if the map is not set then it shouldn'y be considered a successful\n // completion. I am canceling the active drawing by disabling drawing\n // mode and setting the map null in the 'overlaycomplete' event, which\n // fires before the 'polygoncomplete' event.\n if (isNullOrUndefined(polygon.getMap())) {\n return\n }\n\n this._assertInitialized()\n\n // Create a map feature of the drawn polygon.\n const feature = createDataFeatureFromPolygon(polygon)\n // Remove the drawn polygon.\n polygon.setMap(null)\n\n // Stop drawing.\n this._drawingManager?.setDrawingMode(null)\n\n // Check if the feature should be used as a cutout to an existing\n // feature or added as it's own feature.\n const exteriorPolygonFeature = this._allowDrawingHoleInPolygon\n ? getPossibleExteriorFeature(this.googleMap.data, feature)\n : undefined\n if (exteriorPolygonFeature) {\n addInnerFeatureCutoutToExteriorFeature(exteriorPolygonFeature, feature)\n setFeatureSelected(exteriorPolygonFeature, true)\n } else {\n this.googleMap.data.add(feature)\n setFeatureSelected(feature, true)\n }\n })\n }\n }\n\n public isDrawing(): boolean {\n if (isNullOrUndefined(this._drawingManager)) {\n return true\n }\n\n return this._drawingManager.getDrawingMode() !== null\n }\n\n // TODO: Refactor out of the service meant to just wrap the google maps api.\n public hasSelectedFeature(): boolean {\n this._assertInitialized()\n let isSelected = false\n this.googleMap.data.forEach(f => {\n if (isFeatureSelected(f)) {\n isSelected = true\n }\n })\n return isSelected\n }\n\n // TODO: Refactor out of the service meant to just wrap the google maps api.\n public getSelectedFeature(): google.maps.Data.Feature | null {\n this._assertInitialized()\n let feature: google.maps.Data.Feature | null = null\n this.googleMap.data.forEach(f => {\n if (isFeatureSelected(f)) {\n feature = f\n }\n })\n return feature\n }\n\n // TODO: Refactor out of the service meant to just wrap the google maps api.\n public openContextMenu(): void {\n const feature = this.getSelectedFeature()\n if (feature) {\n this._openContextMenuForFeature(feature)\n }\n }\n\n // TODO: Refactor out of the service meant to just wrap the google maps api.\n private _openContextMenuForFeature(feature: google.maps.Data.Feature, position?: google.maps.LatLng) {\n if (this._activeContextMenu) {\n this._activeContextMenu.close()\n this._activeContextMenu = null\n }\n\n this._assertInitialized()\n\n let _position = position\n if (!_position) {\n _position = getFeatureCenter(feature)\n }\n if (this._featureContextMenu) {\n this._activeContextMenu = new GoogleMapsContextMenu(\n this.googleMap,\n this._featureContextMenu,\n _position,\n this._vcr,\n this._ngZone,\n this.googleMap.data,\n feature,\n )\n }\n }\n\n public getGeoJson(removeAppProperties: boolean = true): Promise<object> {\n return new Promise((resolve, reject) => {\n this._assertInitialized()\n this.googleMap.data.toGeoJson(f => {\n if (removeAppProperties) {\n stripAppFeaturePropertiesFromJson(f)\n }\n resolve(f)\n })\n })\n }\n\n /** Asserts that the map has been initialized. */\n private _assertInitialized(): asserts this is WithRequired<GoogleMapsService, 'googleMap'> {\n if (!this.googleMap && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error(\n 'Cannot access Google Map information before the API has been initialized. ' +\n 'Please wait for the API to load before trying to interact with it.',\n )\n }\n }\n}\n","import { InjectionToken } from '@angular/core'\n\nimport { ComponentType } from '@theseam/ui-common/models'\n\nexport interface MapControl<TData = any> {\n component: ComponentType<any>\n data?: TData\n position?: google.maps.ControlPosition\n}\n\nexport interface MapControlsService {\n add(control: MapControl): void\n}\n\nexport const MAP_CONTROLS_SERVICE = new InjectionToken<MapControlsService>('MAP_CONTROLS_SERVICE')\n\nexport const MAP_CONTROL_DATA = new InjectionToken<any>('MAP_CONTROL_DATA')\n","import { ComponentFactoryResolver, ComponentRef, Injectable, Injector, StaticProvider } from '@angular/core'\nimport { Observable, Subject } from 'rxjs'\n\nimport { GoogleMapsService } from './google-maps.service'\nimport { MapControl, MapControlsService, MAP_CONTROL_DATA } from './map-controls-service'\n\nexport class MapControlRef {\n\n private readonly _destroyedSubject = new Subject<void>()\n\n private _componentRef: ComponentRef<any>\n private _addedAtPosition: google.maps.ControlPosition\n\n public destroyed: Observable<void>\n\n constructor(\n private readonly _googleMaps: GoogleMapsService,\n private readonly _componentFactoryResolver: ComponentFactoryResolver,\n private readonly _injector: Injector,\n private readonly _controlDef: MapControl\n ) {\n this.destroyed = this._destroyedSubject.asObservable()\n\n const component: any = this._controlDef.component\n const factory = this._componentFactoryResolver.resolveComponentFactory(component)\n\n const providers: StaticProvider[] = []\n if (this._controlDef.data) {\n providers.push({\n provide: MAP_CONTROL_DATA,\n useValue: this._controlDef.data\n })\n }\n const injector = Injector.create({\n providers,\n parent: this._injector,\n })\n\n this._componentRef = factory.create(injector)\n this._componentRef.changeDetectorRef.detectChanges()\n\n const position = this._controlDef.position ?? google.maps.ControlPosition.LEFT_BOTTOM\n\n this._googleMaps.addControl(\n this._componentRef.location.nativeElement,\n position\n )\n\n this._addedAtPosition = position\n }\n\n public destroy() {\n const googleMaps = this._googleMaps.googleMap\n if (googleMaps !== undefined) {\n let idx = -1\n googleMaps.controls[this._addedAtPosition].forEach((elem, index) => {\n if (elem === this._componentRef.location.nativeElement) {\n idx = index\n }\n })\n if (idx === -1) {\n throw Error(`Unable to destroy control. Control not found.`)\n }\n googleMaps.controls[this._addedAtPosition].removeAt(idx)\n }\n this._componentRef.destroy()\n\n this._destroyedSubject.next()\n this._destroyedSubject.complete()\n }\n\n}\n\n@Injectable()\nexport class GoogleMapsControlsService implements MapControlsService {\n\n constructor(\n private readonly _googleMaps: GoogleMapsService,\n private readonly _componentFactoryResolver: ComponentFactoryResolver,\n private readonly _injector: Injector,\n ) { }\n\n public add(control: MapControl): MapControlRef {\n return new MapControlRef(this._googleMaps, this._componentFactoryResolver, this._injector, control)\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n HostListener,\n Inject,\n Input,\n OnDestroy,\n Optional,\n} from '@angular/core'\nimport { Subject } from 'rxjs'\n\nimport { SeamIcon } from '@theseam/ui-common/icon'\n\nimport { GoogleMapsService } from '../google-maps.service'\nimport { MAP_CONTROL_DATA } from '../map-controls-service'\n\nexport interface GoogleMapsRecenterButtonControlData {\n label?: string | undefined | null\n icon?: SeamIcon | undefined | null\n}\n\n/**\n *\n */\n@Component({\n // tslint:disable-next-line: component-selector\n selector: 'button[seam-google-maps-recenter-button-control]',\n templateUrl: './google-maps-recenter-button-control.component.html',\n styleUrls: ['./google-maps-recenter-button-control.component.scss'],\n host: {\n '[attr.draggable]': 'false',\n '[attr.aria-label]': 'label',\n '[attr.title]': 'label',\n 'type': 'button',\n 'class': 'gmnoprint gm-control-active'\n },\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TheSeamGoogleMapsRecenterButtonControlComponent implements OnDestroy {\n\n private readonly _ngUnsubscribe = new Subject<void>()\n\n private _listeners: (() => void)[] = []\n\n @Input() label: string | undefined | null\n\n @Input() icon: SeamIcon | undefined | null\n\n @HostListener('click', [ 'event' ])\n _onClick(event: MouseEvent) {\n this._googleMaps.reCenterOnFeatures()\n }\n\n constructor(\n private readonly _googleMaps: GoogleMapsService,\n @Optional() @Inject(MAP_CONTROL_DATA) _data?: GoogleMapsRecenterButtonControlData\n ) {\n if (_data) {\n if (_data.hasOwnProperty('label')) {\n this.label = _data.label\n }\n if (_data.hasOwnProperty('icon')) {\n this.icon = _data.icon\n }\n }\n }\n\n /** @ignore */\n ngOnDestroy() {\n this._listeners.forEach(l => l())\n\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostListener,\n Inject,\n Input,\n OnDestroy,\n Optional,\n Renderer2,\n} from '@angular/core'\nimport { Subject } from 'rxjs'\n\nimport { SeamIcon } from '@theseam/ui-common/icon'\nimport { readGeoFile } from '@theseam/ui-common/utils'\n\nimport { GoogleMapsService } from '../google-maps.service'\nimport { MAP_CONTROL_DATA } from '../map-controls-service'\nimport { MapValueManagerService, MapValueSource } from '../map-value-manager.service'\n\nexport interface GoogleMapsUploadButtonControlData {\n label?: string | undefined | null\n icon?: SeamIcon | undefined | null\n}\n\n/**\n *\n */\n@Component({\n // tslint:disable-next-line: component-selector\n selector: 'button[seam-google-maps-upload-button-control]',\n templateUrl: './google-maps-upload-button-control.component.html',\n styleUrls: ['./google-maps-upload-button-control.component.scss'],\n host: {\n '[attr.draggable]': 'false',\n '[attr.aria-label]': 'label',\n '[attr.title]': 'label',\n 'type': 'button',\n 'class': 'gmnoprint gm-control-active'\n },\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TheSeamGoogleMapsUploadButtonControlComponent implements OnDestroy {\n\n private readonly _ngUnsubscribe = new Subject<void>()\n\n private readonly _fileInputElement: HTMLInputElement\n\n private _listeners: (() => void)[] = []\n\n @Input() label: string | undefined | null\n\n @Input() icon: SeamIcon | undefined | null\n\n @HostListener('click', [ 'event' ])\n _onClick(event: MouseEvent) {\n this._fileInputElement.click()\n }\n\n constructor(\n private readonly _elementRef: ElementRef,\n private readonly _mapValueManager: MapValueManagerService,\n private readonly _renderer: Renderer2,\n private readonly _googleMaps: GoogleMapsService,\n @Optional() @Inject(MAP_CONTROL_DATA) _data?: GoogleMapsUploadButtonControlData\n ) {\n if (_data) {\n if (_data.hasOwnProperty('label')) {\n this.label = _data.label\n }\n if (_data.hasOwnProperty('icon')) {\n this.icon = _data.icon\n }\n }\n\n this._fileInputElement = this._createHiddenInput()\n this._renderer.appendChild(this._elementRef.nativeElement, this._fileInputElement)\n }\n\n /** @ignore */\n ngOnDestroy() {\n this._listeners.forEach(l => l())\n\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n\n private _getFile(throwIfInvalidFiles: boolean = true): File | null {\n const files = this._fileInputElement.files\n if (files === null || files.length === 0) {\n return null\n }\n\n if (throwIfInvalidFiles) {\n if (files.length > 1) {\n throw Error(`Only one file can be imported at a time.`)\n }\n }\n\n return files[0]\n }\n\n private async _importFile(file: File): Promise<void> {\n const json = await readGeoFile(file)\n this._mapValueManager.setValue(json, MapValueSource.Input)\n this._resetInput()\n }\n\n private _createHiddenInput(): HTMLInputElement {\n const fileInputElement = this._renderer.createElement('input')\n this._renderer.setAttribute(fileInputElement, 'type', 'file')\n this._renderer.setAttribute(fileInputElement, 'hidden', '')\n this._renderer.setAttribute(fileInputElement, 'accept', '.json,.geojson,.shp,.zip')\n\n this._listeners.push(this._renderer.listen(fileInputElement, 'change', (event: Event) => {\n const file = this._getFile()\n if (file === null) { return }\n const fileImportHandler = this._googleMaps.getFileInputHandler()\n if (fileImportHandler) {\n fileImportHandler(file)\n } else {\n this._importFile(file)\n }\n }))\n\n return fileInputElement\n }\n\n private _createTemporaryFormElement(): HTMLFormElement {\n return this._renderer.createElement('form')\n }\n\n /**\n * Reset input element, so that the same file can be added again.\n */\n private _resetInput(): void {\n const formElement = this._createTemporaryFormElement()\n this._renderer.appendChild(formElement, this._fileInputElement)\n formElement.reset()\n this._renderer.appendChild(this._elementRef.nativeElement, this._fileInputElement)\n }\n}\n","import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y'\nimport { BooleanInput, coerceNumberProperty, NumberInput } from '@angular/cdk/coercion'\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n forwardRef,\n HostBinding,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n SimpleChanges,\n ViewChild,\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\nimport { fromEvent, Subject } from 'rxjs'\nimport { takeUntil, tap } from 'rxjs/operators'\n\nimport { AgmMap } from '@agm/core'\nimport { faCrosshairs, faFileImport } from '@fortawesome/free-solid-svg-icons'\nimport { CanDisable, CanDisableCtor, InputBoolean, InputNumber, mixinDisabled } from '@theseam/ui-common/core'\nimport { MenuComponent } from '@theseam/ui-common/menu'\n\nimport { FeatureCollection } from 'geojson'\nimport { GoogleMapsControlsService } from '../google-maps-controls.service'\nimport { TheSeamGoogleMapsRecenterButtonControlComponent } from '../google-maps-recenter-button-control/google-maps-recenter-button-control.component'\nimport { TheSeamGoogleMapsUploadButtonControlComponent } from '../google-maps-upload-button-control/google-maps-upload-button-control.component'\nimport { GoogleMapsService } from '../google-maps.service'\nimport { MapControl, MAP_CONTROLS_SERVICE } from '../map-controls-service'\nimport { MapValue, MapValueManagerService, MapValueSource } from '../map-value-manager.service'\n\nclass TheSeamGoogleMapsComponentBase {\n constructor(public _elementRef: ElementRef) {}\n}\n\nconst _TheSeamGoogleMapsMixinBase: CanDisableCtor &\n typeof TheSeamGoogleMapsComponentBase =\n mixinDisabled(TheSeamGoogleMapsComponentBase)\n\n/**\n * A wrapper for googlemap.\n */\n@Component({\n selector: 'seam-google-maps',\n templateUrl: './google-maps.component.html',\n styleUrls: ['./google-maps.component.scss'],\n inputs: [\n 'disabled'\n ],\n providers: [\n MapValueManagerService,\n GoogleMapsService,\n { provide: MAP_CONTROLS_SERVICE, useClass: GoogleMapsControlsService },\n {\n provide: NG_VALUE_ACCESSOR,\n // tslint:disable-next-line: no-use-before-declare\n useExisting: forwardRef(() => TheSeamGoogleMapsComponent),\n multi: true\n }\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n exportAs: 'seamGoogleMaps'\n})\nexport class TheSeamGoogleMapsComponent extends _TheSeamGoogleMapsMixinBase\n implements OnInit, AfterViewInit, OnDestroy, OnChanges, CanDisable, ControlValueAccessor {\n static ngAcceptInputType_disabled: BooleanInput\n static ngAcceptInputType_zoom: NumberInput\n static ngAcceptInputType_longitude: NumberInput\n static ngAcceptInputType_latitude: NumberInput\n static ngAcceptInputType_fileDropEnabled: BooleanInput\n static ngAcceptInputType_fileUploadControlEnabled: BooleanInput\n static ngAcceptInputType_fullscreenControlEnabled: BooleanInput\n static ngAcceptInputType_reCenterControlEnabled: BooleanInput\n static ngAcceptInputType_mapTypeControlEnabled: BooleanInput\n static ngAcceptInputType_streetViewControlEnabled: BooleanInput\n static ngAcceptInputType_allowDrawingHoleInPolygon: BooleanInput\n\n private readonly _ngUnsubscribe = new Subject<void>()\n\n readonly _fileUploadControlDef: MapControl = {\n component: TheSeamGoogleMapsUploadButtonControlComponent,\n data: { label: 'Import Geo File', icon: faFileImport },\n position: 6 /* google.maps.ControlPosition.LEFT_BOTTOM */,\n }\n\n readonly _reCenterControlDef: MapControl = {\n component: TheSeamGoogleMapsRecenterButtonControlComponent,\n data: { label: 'Center on Field', icon: faCrosshairs },\n position: 9 /* google.maps.ControlPosition.RIGHT_BOTTOM */,\n }\n\n private _focusOrigin: FocusOrigin = null\n\n @Input()\n set value(value: MapValue) {\n this._mapValueManager.setValue(value, MapValueSource.Input)\n }\n get value(): MapValue {\n return this._mapValueManager.value\n }\n\n @Input()\n set tabIndex(value: number) { this._tabIndex = coerceNumberProperty(value) }\n get tabIndex(): number { return this._tabIndex }\n /**\n * Set the tab index to `-1` to allow the root element of the\n * component to receive `focus` event from javascript, but not get focused by\n * keyboard navigation.\n */\n private _tabIndex = -1\n\n @Input() @InputBoolean() fileDropEnabled: boolean = true\n\n @Input() @InputBoolean() fileUploadControlEnabled: boolean = false\n @Input() @InputBoolean() fullscreenControlEnabled: boolean = true\n @Input() @InputBoolean() reCenterControlEnabled: boolean = true\n @Input() @InputBoolean() mapTypeControlEnabled: boolean = true\n @Input() @InputBoolean() streetViewControlEnabled: boolean = false\n\n @Input() @InputBoolean() allowDrawingHoleInPolygon: boolean = false\n\n @Input()\n set fileImportHandler(value: ((file: File) => void) | undefined | null) {\n this._googleMaps.setFileInputHandler(value)\n }\n\n @HostBinding('attr.disabled')\n get _attrDisabled() { return this.disabled || null }\n\n @HostBinding('attr.tabindex')\n get _attrTabIndex() { return this.disabled ? -1 : (this.tabIndex || 0) }\n\n onChange: any\n onTouched: any\n\n @Input() @InputNumber() zoom: number = 14\n @Input() @InputNumber() longitude: number = -98.570209\n @Input() @InputNumber() latitude: number = 37.633814\n\n @Output() mapReady = new EventEmitter<void>()\n\n @ViewChild(AgmMap, { static: true }) public agmMap!: AgmMap\n @ViewChild('featureContextMenu', { static: true, read: MenuComponent }) public featureContextMenu!: MenuComponent\n\n @ViewChild(AgmMap, { static: true, read: ElementRef }) public agmMapTpl!: ElementRef<HTMLElement>\n\n constructor(\n elementRef: ElementRef,\n private readonly _focusMonitor: FocusMonitor,\n private readonly _googleMaps: GoogleMapsService,\n private readonly _mapValueManager: MapValueManagerService,\n ) {\n super(elementRef)\n\n this._focusMonitor.monitor(this._elementRef, true).pipe(\n tap(origin => this._focusOrigin = origin),\n takeUntil(this._ngUnsubscribe),\n ).subscribe()\n\n this._mapValueManager.valueChanged.pipe(\n tap(change => {\n if (this.onChange) { this.onChange(change.value) }\n if (this.onTouched) { this.onTouched() }\n }),\n tap(changed => {\n if (this._googleMaps.mapReady && changed.source !== MapValueSource.FeatureChange) {\n this._googleMaps.setData(changed.value)\n }\n }),\n takeUntil(this._ngUnsubscribe),\n ).subscribe()\n\n this._googleMaps.setBaseLatLng(this.latitude, this.longitude)\n }\n\n /** @ignore */\n ngOnInit() {\n this._googleMaps.setFeatureContextMenu(this.featureContextMenu)\n\n fromEvent<KeyboardEvent>(window, 'keydown').pipe(\n tap((event: KeyboardEvent) => {\n switch (event.code) {\n case 'Delete': this._googleMaps.deleteSelection(); event.preventDefault(); event.stopPropagation(); break\n case 'Escape': this._googleMaps.stopDrawing(); event.preventDefault(); event.stopPropagation(); break\n case 'ContextMenu': this._googleMaps.openContextMenu(); event.preventDefault(); event.stopPropagation(); break\n }\n }),\n takeUntil(this._ngUnsubscribe)\n ).subscribe()\n }\n\n /** @ignore */\n ngOnDestroy() {\n this._focusMonitor.stopMonitoring(this._elementRef)\n\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n\n /** @ignore */\n ngAfterViewInit() { }\n\n ngOnChanges(changes: SimpleChanges): void {\n let updateBase = false\n if (changes.hasOwnProperty('latitude')) {\n this.latitude = changes['latitude'].currentValue\n updateBase = true\n }\n if (changes.hasOwnProperty('longitude')) {\n this.longitude = changes['longitude'].currentValue\n updateBase = true\n }\n if (updateBase) {\n this._googleMaps.setBaseLatLng(this.latitude, this.longitude)\n }\n\n if (changes.hasOwnProperty('allowDrawingHoleInPolygon')) {\n this._googleMaps.allowDrawingHoleInPolygon(this.allowDrawingHoleInPolygon)\n }\n }\n\n writeValue(value: MapValue): void {\n this.value = value\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn\n }\n\n registerOnTouched(fn: any): void {\n this.onTouched = fn\n }\n\n setDisabledState?(isDisabled: boolean): void {\n this.disabled = isDisabled\n }\n\n public fitBounds(bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral, padding?: number | google.maps.Padding): void {\n this._googleMaps.fitBounds(bounds, padding)\n }\n\n public getGeoJson(): Promise<object> {\n return this._googleMaps.getGeoJson()\n }\n\n public hasFocus(): boolean {\n return this._focusOrigin !== null && this._focusOrigin !== undefined\n }\n\n /** Focuses the button. */\n public focus(): void {\n this._getHostElement().focus()\n }\n\n private _getHostElement() {\n return this._elementRef.nativeElement\n }\n\n _onMapReady(theMap: google.maps.Map) {\n this._googleMaps.setMap(theMap)\n this._googleMaps.setData(this._mapValueManager.value)\n // NOTE: AgmMap has a race condition problem that causes the input latitude,\n // longitude, and zoom to get ignored, before googlemaps emits\n // 'center_changed'. This should avoid the issue, until we stop using AgmMap\n // or upgrade to a more recent version that may not have the issue anymore.\n this._googleMaps.reCenterOnFeatures()\n this._googleMaps.googleMap?.setZoom(this.zoom)\n }\n\n _onClickDeleteFeature() {\n this._googleMaps.deleteSelection()\n }\n}\n","import { Directive, ElementRef, HostBinding, Input, NgZone, OnChanges, OnDestroy, OnInit, Output, SimpleChanges } from '@angular/core'\r\nimport { interval, Observable, Subject, Subscriber } from 'rxjs'\r\nimport { filter, mapTo, startWith, switchMap, take, takeUntil } from 'rxjs/operators'\r\n\r\ndeclare const ngDevMode: boolean | undefined\r\ntype WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] }\r\n\r\nexport const SEAM_GOOGLE_PLACES_AUTOCOMPLETE_DEFAULT_OPTIONS: google.maps.places.AutocompleteOptions = {\r\n componentRestrictions: { country: 'US' }\r\n}\r\n\r\n@Directive({\r\n selector: 'input[seamGoogleMapsPlacesAutocomplete]',\r\n exportAs: 'seamGoogleMapsPlacesAutocomplete'\r\n})\r\nexport class TheSeamGoogleMapsPlacesAutocompleteDirective implements OnInit, OnDestroy, OnChanges {\r\n private readonly _autoCompleteReadySubject = new Subject()\r\n private readonly _ngUnsubscribe = new Subject()\r\n\r\n private _placeChangedPending: { observable: Observable<any>, subscriber: Subscriber<any> }[] = []\r\n private _listeners: google.maps.MapsEventListener[] = []\r\n\r\n public autoComplete?: google.maps.places.Autocomplete\r\n\r\n @Input()\r\n set options(value: google.maps.places.AutocompleteOptions | undefined | null) {\r\n this._options = value || SEAM_GOOGLE_PLACES_AUTOCOMPLETE_DEFAULT_OPTIONS\r\n }\r\n private _options: google.maps.places.AutocompleteOptions = SEAM_GOOGLE_PLACES_AUTOCOMPLETE_DEFAULT_OPTIONS\r\n\r\n /**\r\n * This event is fired when a PlaceResult is made available for a Place the\r\n * user has selected. If the user enters the name of a Place that was not\r\n * suggested by the control and presses the Enter key, or if a Place Details\r\n * request fails, the PlaceResult contains the user input in the name\r\n * property, with no other properties defined.\r\n *\r\n * See: https://developers.google.com/maps/documentation/javascript/reference/places-widget#Autocomplete.place_changed\r\n */\r\n @Output() readonly placeChanged: Observable<any>\r\n\r\n @HostBinding('attr.type') _attrType = 'text'\r\n\r\n constructor(\r\n private readonly _elementRef: ElementRef<HTMLInputElement>,\r\n private readonly _ngZone: NgZone,\r\n ) {\r\n this.placeChanged = this._autoCompleteReadySubject.pipe(\r\n startWith(undefined),\r\n switchMap(() => this._createPlaceChangedObservable<any>())\r\n )\r\n }\r\n\r\n ngOnInit(): void {\r\n this._ngZone.runOutsideAngular(() => {\r\n this._untilGoogleMapsApiLoaded().pipe(takeUntil(this._ngUnsubscribe)).subscribe(() => {\r\n this.autoComplete = new google.maps.places.Autocomplete(this.getHostElement(), this._options)\r\n\r\n this._placeChangedPending.forEach(pending => pending.observable.subscribe(pending.subscriber))\r\n\r\n this._autoCompleteReadySubject.next()\r\n })\r\n })\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this._listeners.forEach(l => l.remove())\r\n this._listeners = []\r\n\r\n this._ngUnsubscribe.next()\r\n this._ngUnsubscribe.complete()\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n if (this.autoComplete && changes['options']) {\r\n this.autoComplete.setOptions(this._options)\r\n }\r\n }\r\n\r\n private _untilGoogleMapsApiLoaded(): Observable<void> {\r\n return interval(500).pipe(\r\n filter(() => !!(window.google && window.google.maps && window.google.maps.version)),\r\n take(1),\r\n mapTo(undefined),\r\n )\r\n }\r\n\r\n /**\r\n * Returns the bounds to which predictions are biased.\r\n */\r\n public getBounds(): google.maps.LatLngBounds | undefined {\r\n this._assertInitialized()\r\n return this.autoComplete.getBounds()\r\n }\r\n\r\n /**\r\n * Returns the fields to be included for the Place in the details response\r\n * when the details are successfully retrieved. For a list of fields see\r\n * [PlaceResult](https://developers.google.com/maps/documentation/javascript/reference/places-service#PlaceResult).\r\n */\r\n public getFields(): string[] | undefined {\r\n this._assertInitialized()\r\n return (this.autoComplete as any).getFields()\r\n }\r\n\r\n /**\r\n * Returns the details of the Place selected by user if the details were\r\n * successfully retrieved. Otherwise returns a stub Place object, with the\r\n * name property set to the current value of the input field.\r\n */\r\n public getPlace(): google.maps.places.PlaceResult {\r\n this._assertInitialized()\r\n return this.autoComplete.getPlace()\r\n }\r\n\r\n /**\r\n * Sets the preferred area within which to return Place results. Results are\r\n * biased towards, but not restricted to, this area.\r\n */\r\n public setBounds(bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral): void {\r\n this._assertInitialized()\r\n // tslint:disable-next-line: no-non-null-assertion\r\n return this.autoComplete.setBounds(bounds!)\r\n }\r\n\r\n /**\r\n * Sets the component restrictions. Component restrictions are used to\r\n * restrict predictions to only those within the parent component. For\r\n * example, the country.\r\n */\r\n public setComponentRestrictions(restrictions?: google.maps.places.ComponentRestrictions): void {\r\n this._assertInitialized()\r\n // tslint:disable-next-line: no-non-null-assertion\r\n return this.autoComplete.setComponentRestrictions(restrictions!)\r\n }\r\n\r\n /**\r\n * Sets the fields to be included for the Place in the details response when\r\n * the details are successfully retrieved. For a list of fields see\r\n * [PlaceResult](https://developers.google.com/maps/documentation/javascript/reference/places-service#PlaceResult).\r\n */\r\n public setFields(fields?: string[]): void {\r\n this._assertInitialized()\r\n // tslint:disable-next-line: no-non-null-assertion\r\n return this.autoComplete.setFields(fields!)\r\n }\r\n\r\n /** */\r\n public setOptions(options?: google.maps.places.AutocompleteOptions): void {\r\n this._assertInitialized()\r\n // tslint:disable-next-line: no-non-null-assertion\r\n return this.autoComplete.setOptions(options!)\r\n }\r\n\r\n /**\r\n * Sets the types of predictions to be returned. For supported types, see the\r\n * [developer's guide](https://developers.google.com/maps/documentation/javascript/places-autocomplete#constrain-place-types).\r\n * If no types are specified, all types will be returned.\r\n */\r\n public setTypes(types?: string[]): void {\r\n this._assertInitialized()\r\n // tslint:disable-next-line: no-non-null-assertion\r\n return this.autoComplete.setTypes(types!)\r\n }\r\n\r\n /** Focuses the input. */\r\n public focus(): void {\r\n this._elementRef.nativeElement.focus()\r\n }\r\n\r\n /** Unfocuses the input. */\r\n public blur(): void {\r\n this._elementRef.nativeElement.blur()\r\n }\r\n\r\n public getHostElement(): HTMLInputElement {\r\n return this._elementRef.nativeElement\r\n }\r\n\r\n private _createPlaceChangedObservable<T>(): Observable<T> {\r\n const observable = new Observable<T>(subscriber => {\r\n if (!this.autoComplete) {\r\n this._placeChangedPending.push({ observable, subscriber })\r\n return undefined\r\n }\r\n const listener = this.autoComplete.addListener('place_changed', (event: T) => {\r\n this._ngZone.run(() => subscriber.next(event))\r\n })\r\n this._listeners.push(listener)\r\n\r\n return () => listener.remove()\r\n })\r\n return observable\r\n }\r\n\r\n /** Asserts that the map has been initialized. */\r\n private _assertInitialized(): asserts this is WithRequired<TheSeamGoogleMapsPlacesAutocompleteDirective, 'autoComplete'> {\r\n if (!this.autoComplete && (typeof ngDevMode === 'undefined' || ngDevMode)) {\r\n throw Error(\r\n 'Cannot access Google Map Places information before the API has been initialized. ' +\r\n 'Please wait for the API to load before trying to interact with it.',\r\n )\r\n }\r\n }\r\n}\r\n","import { BooleanInput, coerceNumberProperty } from '@angular/cdk/coercion'\r\nimport {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ElementRef,\r\n HostBinding,\r\n HostListener,\r\n Input,\r\n OnDestroy,\r\n OnInit,\r\n Output,\r\n ViewChild,\r\n} from '@angular/core'\r\nimport { interval, Observable, of, Subject, Subscriber } from 'rxjs'\r\nimport { filter, mapTo, startWith, switchMap, take, takeUntil } from 'rxjs/operators'\r\n\r\nimport { faSearchLocation } from '@fortawesome/free-solid-svg-icons'\r\nimport { InputBoolean } from '@theseam/ui-common/core'\r\nimport { InputDirective } from '@theseam/ui-common/form-field'\r\nimport { SeamIcon } from '@theseam/ui-common/icon'\r\n\r\nimport { SEAM_GOOGLE_PLACES_AUTOCOMPLETE_DEFAULT_OPTIONS, TheSeamGoogleMapsPlacesAutocompleteDirective } from './google-maps-places-autocomplete.directive'\r\n\r\ndeclare const ngDevMode: boolean | undefined\r\ntype WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] }\r\n\r\n/**\r\n *\r\n */\r\n@Component({\r\n selector: 'seam-google-maps-places-autocomplete',\r\n templateUrl: './google-maps-places-autocomplete.component.html',\r\n styleUrls: ['./google-maps-places-autocomplete.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n exportAs: 'seamGoogleMapsPlacesAutoComplete'\r\n})\r\nexport class TheSeamGoogleMapsPlacesAutoCompleteComponent implements OnInit, OnDestroy {\r\n static ngAcceptInputType_disabled: BooleanInput\r\n\r\n private readonly _ngUnsubscribe = new Subject<void>()\r\n private readonly _autoCompleteReadySubject = new Subject()\r\n\r\n private _placeChangedPending: { observable: Observable<any>, subscriber: Subscriber<any> }[] = []\r\n\r\n public autoComplete?: google.maps.places.Autocomplete\r\n\r\n @Input() label: string | undefined | null = 'Search by address, place or name'\r\n\r\n @Input() icon: SeamIcon | undefined | null = faSearchLocation\r\n\r\n @Input() @InputBoolean() disabled: BooleanInput = false\r\n\r\n @Input() placeholder: string | undefined | null = 'Enter address, place or name'\r\n\r\n @Input() autocorrect: 'off' | 'on' | undefined | null = 'off'\r\n\r\n @Input() autocapitalize: 'off' | 'on' | undefined | null = 'off'\r\n\r\n /**\r\n * Set the tab index to `-1` to allow the root element of the\r\n * component to receive `focus` event from javascript, but not get focused by\r\n * keyboard navigation.\r\n */\r\n @Input()\r\n set tabIndex(value: number) { this._tabIndex = coerceNumberProperty(value) }\r\n get tabIndex(): number { return this._tabIndex }\r\n private _tabIndex = -1\r\n\r\n @Input()\r\n set options(value: google.maps.places.AutocompleteOptions | undefined | null) {\r\n this._options = value || SEAM_GOOGLE_PLACES_AUTOCOMPLETE_DEFAULT_OPTIONS\r\n }\r\n _options: google.maps.places.AutocompleteOptions = SEAM_GOOGLE_PLACES_AUTOCOMPLETE_DEFAULT_OPTIONS\r\n\r\n /**\r\n * This event is fired when a PlaceResult is made available for a Place the\r\n * user has selected. If the user enters the name of a Place that was not\r\n * suggested by the control and presses the Enter key, or if a Place Details\r\n * request fails, the PlaceResult contains the user input in the name\r\n * property, with no other properties defined.\r\n *\r\n * See: https://developers.google.com/maps/documentation/javascript/reference/places-widget#Autocomplete.place_changed\r\n */\r\n @Output() readonly placeChanged: Observable<void>\r\n\r\n @ViewChild('inp', { read: InputDirective, static: true }) _inputDirective!: InputDirective\r\n\r\n @ViewChild(TheSeamGoogleMapsPlacesAutocompleteDirective, { static: true })\r\n set __autocompleteDirective(value: TheSeamGoogleMapsPlacesAutocompleteDirective) {\r\n this._autoCompleteDirective = value\r\n this._untilAutoCompleteReady().pipe(takeUntil(this._ngUnsubscribe)).subscribe(() => {\r\n this.autoComplete = this._autoCompleteDirective.autoComplete\r\n this._placeChangedPending.forEach(pending => pending.observable.subscribe(pending.subscriber))\r\n this._placeChangedPending = []\r\n })\r\n }\r\n _autoCompleteDirective!: TheSeamGoogleMapsPlacesAutocompleteDirective\r\n\r\n @HostBinding('attr.tabindex')\r\n get _attrTabIndex() { return this.disabled ? -1 : (this.tabIndex || 0) }\r\n\r\n @HostListener('click', [ 'event' ])\r\n _onClick(event: MouseEvent) {\r\n this._inputDirective.focus()\r\n }\r\n\r\n @HostListener('focus', [ '$event' ])\r\n _onFocus() {\r\n this._inputDirective?.focus()\r\n }\r\n\r\n constructor(\r\n private readonly _elementRef: ElementRef,\r\n ) {\r\n this.placeChanged = this._autoCompleteReadySubject.pipe(\r\n startWith(undefined),\r\n switchMap(() => this._createPlaceChangedObservable<any>())\r\n )\r\n }\r\n\r\n ngOnInit() { }\r\n\r\n /** @ignore */\r\n ngOnDestroy() {\r\n this._ngUnsubscribe.next()\r\n this._ngUnsubscribe.complete()\r\n }\r\n\r\n private _untilAutoCompleteReady(): Observable<void> {\r\n return interval(500).pipe(\r\n filter(() => !!this._autoCompleteDirective.autoComplete),\r\n take(1),\r\n mapTo(undefined),\r\n )\r\n }\r\n\r\n /**\r\n * Returns the bounds to which predictions are biased.\r\n */\r\n public getBounds(): google.maps.LatLngBounds | undefined {\r\n this._assertInitialized()\r\n return this.autoComplete.getBounds()\r\n }\r\n\r\n /**\r\n * Returns the fields to be included for the Place in the details response\r\n * when the details are successfully retrieved. For a list of fields see\r\n * [PlaceResult](https://developers.google.com/maps/documentation/javascript/reference/places-service#PlaceResult).\r\n */\r\n public getFields(): string[] | undefined {\r\n this._assertInitialized()\r\n return (this.autoComplete as any).getFields()\r\n }\r\n\r\n /**\r\n * Returns the details of the Place selected by user if the details were\r\n * successfully retrieved. Otherwise returns a stub Place object, with the\r\n * name property set to the current value of the input field.\r\n */\r\n public getPlace(): google.maps.places.PlaceResult {\r\n this._assertInitialized()\r\n return this.autoComplete.getPlace()\r\n }\r\n\r\n /**\r\n * Sets the preferred area within which to return Place results. Results are\r\n * biased towards, but not restricted to, this area.\r\n */\r\n public setBounds(bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral): void {\r\n this._assertInitialized()\r\n // tslint:disable-next-line: no-non-null-assertion\r\n return this.autoComplete.setBounds(bounds!)\r\n }\r\n\r\n /**\r\n * Sets the component restrictions. Component restrictions are used to\r\n * restrict predictions to only those within the parent component. For\r\n * example, the country.\r\n */\r\n public setComponentRestrictions(restrictions?: google.maps.places.ComponentRestrictions): void {\r\n this._assertInitialized()\r\n // tslint:disable-next-line: no-non-null-assertion\r\n return this.autoComplete.setComponentRestrictions(restrictions!)\r\n }\r\n\r\n /**\r\n * Sets the fields to be included for the Place in the details response when\r\n * the details are successfully retrieved. For a list of fields see\r\n * [PlaceResult](https://developers.google.com/maps/documentation/javascript/reference/places-service#PlaceResult).\r\n */\r\n public setFields(fields?: string[]): void {\r\n this._assertInitialized()\r\n // tslint:disable-next-line: no-non-null-assertion\r\n return this.autoComplete.setFields(fields!)\r\n }\r\n\r\n /** */\r\n public setOptions(options?: google.maps.places.AutocompleteOptions): void {\r\n this._assertInitialized()\r\n // tslint:disable-next-line: no-non-null-assertion\r\n return this.autoComplete.setOptions(options!)\r\n }\r\n\r\n /**\r\n * Sets the types of predictions to be returned. For supported types, see the\r\n * [developer's guide](https://developers.google.com/maps/documentation/javascript/places-autocomplete#constrain-place-types).\r\n * If no types are specified, all types will be returned.\r\n */\r\n public setTypes(types?: string[]): void {\r\n this._assertInitialized()\r\n // tslint:disable-next-line: no-non-null-assertion\r\n return this.autoComplete.setTypes(types!)\r\n }\r\n\r\n /** Focuses the input. */\r\n public focus(): void {\r\n this._elementRef.nativeElement.focus()\r\n }\r\n\r\n /** Unfocuses the input. */\r\n public blur(): void {\r\n this._elementRef.nativeElement.blur()\r\n }\r\n\r\n public getHostElement(): HTMLInputElement {\r\n return this._elementRef.nativeElement\r\n }\r\n\r\n private _createPlaceChangedObservable<T>(): Observable<T> {\r\n const observable = new Observable<T>(subscriber => {\r\n if (!this.autoComplete) {\r\n this._placeChangedPending.push({ observable, subscriber })\r\n return undefined\r\n }\r\n\r\n const sub = this._autoCompleteDirective.placeChanged.subscribe(subscriber)\r\n\r\n return () => sub.unsubscribe()\r\n })\r\n return observable\r\n }\r\n\r\n /** Asserts that the map has been initialized. */\r\n private _assertInitialized(): asserts this is WithRequired<TheSeamGoogleMapsPlacesAutoCompleteComponent, 'autoComplete'> {\r\n if (!this.autoComplete && (typeof ngDevMode === 'undefined' || ngDevMode)) {\r\n throw Error(\r\n 'Cannot access Google Map Places information before the API has been initialized. ' +\r\n 'Please wait for the API to load before trying to interact with it.',\r\n )\r\n }\r\n }\r\n\r\n}\r\n","import { OnInit } from '@angular/core'\nimport {\n ChangeDetectionStrategy,\n Component,\n Inject,\n Input,\n OnDestroy,\n} from '@angular/core'\nimport { Subject } from 'rxjs'\nimport { takeUntil, tap } from 'rxjs/operators'\n\nimport { GoogleMapsControlsService, MapControlRef } from './google-maps-controls.service'\nimport { GoogleMapsService } from './google-maps.service'\nimport { MapControl, MAP_CONTROLS_SERVICE } from './map-controls-service'\n\n@Component({\n selector: 'seam-map-control',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TheSeamMapsControlComponent implements OnInit, OnDestroy {\n private readonly _ngUnsubscribe = new Subject<void>()\n\n private _controlRef?: MapControlRef\n\n @Input()\n set def(value: MapControl | null | undefined) {\n if (value !== this._def) {\n this._remove()\n this._def = value\n }\n }\n _def: MapControl | null | undefined\n\n constructor(\n private readonly _googleMaps: GoogleMapsService,\n @Inject(MAP_CONTROLS_SERVICE) private readonly _googleMapsControls: GoogleMapsControlsService,\n ) { }\n\n /** @ignore */\n ngOnInit(): void {\n this._googleMaps.mapReady$.pipe(\n tap(ready => {\n if (ready) {\n this._add()\n } else {\n this._remove()\n }\n }),\n takeUntil(this._ngUnsubscribe)\n ).subscribe()\n }\n\n /** @ignore */\n ngOnDestroy(): void {\n this._remove()\n\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n\n private _add(): void {\n if (this._controlRef) {\n return\n }\n\n if (this._def === null || this._def === undefined) {\n return\n }\n\n this._controlRef = this._googleMapsControls.add(this._def)\n }\n\n private _remove(): void {\n this._controlRef?.destroy()\n this._controlRef = undefined\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n NgZone,\n OnDestroy,\n OnInit,\n Renderer2,\n} from '@angular/core'\nimport { Subject } from 'rxjs'\nimport { takeUntil, tap } from 'rxjs/operators'\n\nimport { readGeoFile } from '@theseam/ui-common/utils'\n\nimport { GoogleMapsService } from '../google-maps.service'\nimport { MapValueManagerService, MapValueSource } from '../map-value-manager.service'\n\n/**\n *\n */\n@Component({\n selector: 'seam-map-file-drop',\n templateUrl: './map-file-drop.component.html',\n styleUrls: ['./map-file-drop.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TheSeamMapFileDropComponent implements OnInit, OnDestroy {\n\n private readonly _ngUnsubscribe = new Subject<void>()\n\n /**\n * Map element drag events added to.\n */\n private _mapDiv: HTMLDivElement | undefined\n\n private _listeners: (() => void)[] = []\n\n private _globalDragInProgress: boolean = false\n\n constructor(\n private readonly _elementRef: ElementRef,\n private readonly _ngZone: NgZone,\n private readonly _googleMaps: GoogleMapsService,\n private readonly _mapValueManager: MapValueManagerService,\n private readonly _renderer: Renderer2\n ) { }\n\n /** @ignore */\n ngOnInit() {\n this._googleMaps.mapReady$.pipe(\n tap(ready => {\n if (ready) {\n this._enableFileDrop()\n } else {\n this._disableFileDrop()\n }\n }),\n takeUntil(this._ngUnsubscribe)\n ).subscribe()\n }\n\n /** @ignore */\n ngOnDestroy() {\n this._disableFileDrop()\n\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n\n private _enableFileDrop(): void {\n const divElement = this._googleMaps.getDiv()\n if (this._mapDiv === divElement) {\n return\n }\n\n if (this._mapDiv !== undefined) {\n // Disable file drop on previous map div.\n this._disableFileDrop()\n }\n\n this._mapDiv = divElement\n this._ngZone.runOutsideAngular(() => {\n this._listeners.push(this._renderer.listen('document', 'dragstart', (event: Event) => {\n this._globalDragInProgress = true\n }))\n\n this._listeners.push(this._renderer.listen('document', 'dragend', (event: Event) => {\n this._globalDragInProgress = false\n }))\n\n this._listeners.push(this._renderer.listen(divElement, 'dragover', this._handleDragOverEvent))\n this._listeners.push(this._renderer.listen(this._elementRef.nativeElement, 'dragover', this._handleDragOverEvent))\n this._listeners.push(this._renderer.listen(this._elementRef.nativeElement, 'drop', this._handleDropEvent))\n this._listeners.push(this._renderer.listen(divElement, 'dragenter', this._handleDragEnterEvent))\n this._listeners.push(this._renderer.listen(this._elementRef.nativeElement, 'dragleave', this._handleDragLeaveEvent))\n })\n }\n\n private _disableFileDrop(): void {\n if (this._listeners.length > 0) {\n this._listeners.forEach(l => l())\n this._listeners = []\n }\n }\n\n private readonly _handleDragOverEvent = (event: any) => {\n if (!this._dropAllowed()) {\n return\n }\n\n if (!this._isSupportedDataTransferTypes(event.dataTransfer)) {\n return\n }\n\n event.preventDefault()\n event.dataTransfer.dropEffect = 'copy'\n }\n\n private readonly _handleDropEvent = (event: any) => {\n if (!this._dropAllowed()) {\n return\n }\n\n event.preventDefault()\n event.stopPropagation()\n this._renderer.setStyle(this._elementRef.nativeElement, 'display', 'none')\n\n // TODO: Show error if multiple files?\n if (!this._isSupportedDataTransfer(event.dataTransfer)) {\n return\n }\n\n const item = event.dataTransfer.items[0]\n const file = item.getAsFile()\n readGeoFile(file).then(json => {\n this._mapValueManager.setValue(json, MapValueSource.Input)\n })\n }\n\n private readonly _handleDragEnterEvent = (event: any) => {\n if (!this._dropAllowed()) {\n return\n }\n\n if (!this._isSupportedDataTransferTypes(event.dataTransfer)) {\n return\n }\n\n this._renderer.setStyle(this._elementRef.nativeElement, 'display', 'block')\n }\n\n private readonly _handleDragLeaveEvent = (event: any) => {\n if (!this._dropAllowed()) {\n return\n }\n\n this._renderer.setStyle(this._elementRef.nativeElement, 'display', 'none')\n }\n\n private _dropAllowed(): boolean {\n return !this._globalDragInProgress\n }\n\n private _isSupportedDataTransfer(dataTransfer: DataTransfer): boolean {\n return dataTransfer.files.length === 1 && dataTransfer.types[0] === 'Files'\n }\n\n private _isSupportedDataTransferTypes(dataTransfer: DataTransfer): boolean {\n return dataTransfer.types[0] === 'Files'\n }\n\n}\n","import { ObserversModule } from '@angular/cdk/observers'\nimport { CommonModule } from '@angular/common'\nimport { NgModule } from '@angular/core'\n\nimport { AgmCoreModule } from '@agm/core'\nimport { TheSeamFormFieldModule } from '@theseam/ui-common/form-field'\nimport { TheSeamIconModule } from '@theseam/ui-common/icon'\nimport { TheSeamMenuModule } from '@theseam/ui-common/menu'\nimport { TheSeamSharedModule } from '@theseam/ui-common/shared'\n\nimport { TheSeamGoogleMapsPlacesAutoCompleteComponent } from './google-maps-places-autocomplete/google-maps-places-autocomplete.component'\nimport { TheSeamGoogleMapsPlacesAutocompleteDirective } from './google-maps-places-autocomplete/google-maps-places-autocomplete.directive'\nimport { TheSeamGoogleMapsRecenterButtonControlComponent } from './google-maps-recenter-button-control/google-maps-recenter-button-control.component'\nimport { TheSeamGoogleMapsUploadButtonControlComponent } from './google-maps-upload-button-control/google-maps-upload-button-control.component'\nimport { TheSeamGoogleMapsComponent } from './google-maps/google-maps.component'\nimport { TheSeamMapsControlComponent } from './map-control.component'\nimport { TheSeamMapFileDropComponent } from './map-file-drop/map-file-drop.component'\n\n@NgModule({\n declarations: [\n TheSeamGoogleMapsComponent,\n TheSeamMapFileDropComponent,\n TheSeamGoogleMapsUploadButtonControlComponent,\n TheSeamGoogleMapsRecenterButtonControlComponent,\n TheSeamMapsControlComponent,\n TheSeamGoogleMapsPlacesAutocompleteDirective,\n TheSeamGoogleMapsPlacesAutoCompleteComponent,\n ],\n imports: [\n CommonModule,\n ObserversModule,\n TheSeamSharedModule,\n TheSeamMenuModule,\n TheSeamIconModule,\n TheSeamFormFieldModule,\n AgmCoreModule,\n ],\n exports: [\n TheSeamGoogleMapsComponent,\n TheSeamGoogleMapsPlacesAutocompleteDirective,\n TheSeamGoogleMapsPlacesAutoCompleteComponent\n ]\n})\nexport class TheSeamGoogleMapsModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {MAP_CONTROLS_SERVICE as ɵb,MAP_CONTROL_DATA as ɵc,MapControl as ɵa} from './map-controls-service';"],"names":["polygon","turfjsPolygon","multiPolygon","turfjsMultiPolygon"],"mappings":";;;;;;;;;;;;;;;;;;;;;IAWY;AAAZ,WAAY,sBAAsB;IAChC,0DAAgC,CAAA;AAClC,CAAC,EAFW,sBAAsB,KAAtB,sBAAsB,QAEjC;SAEe,oBAAoB,CAAC,YAAoB;IACvD,OAAO,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC;SACzC,SAAS,CAAC,KAAK,IAAI,KAAK,KAAK,YAAY,CAAC,KAAK,CAAC,CAAC,CAAA;AACtD,CAAC;SAEe,iBAAiB,CAAC,OAAiC;IACjE,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAAA;IACzE,OAAO,qBAAqB,CAAC,UAAU,CAAC,CAAA;AAC1C,CAAC;SAEe,kBAAkB,CAAC,OAAiC,EAAE,UAAmB;IACvF,OAAO,CAAC,WAAW,CAAC,sBAAsB,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;AACpE,CAAC;AAED;AACA;AACA;SACgB,iCAAiC,CAAC,IAAS;IACzD,IAAI,kBAAkB,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,QAAQ,CAAC,EAAE;QAC7D,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE;YACnC,IAAI,kBAAkB,CAAC,OA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YAAY;oBACZ,eAAe;oBACf,mBAAmB;oBACnB,iBAAiB;oBACjB,iBAAiB;oBACjB,sBAAsB;oBACtB,aAAa;iBACd;gBACD,OAAO,EAAE;oBACP,0BAA0B;oBAC1B,4CAA4C;oBAC5C,4CAA4C;iBAC7C;aACF;;;AC1CD;;;;;;"}
1
+ {"version":3,"file":"theseam-ui-common-google-maps.js","sources":["../../../projects/ui-common/google-maps/google-maps-feature-helpers.ts","../../../projects/ui-common/google-maps/google-maps-contextmenu.ts","../../../projects/ui-common/google-maps/map-value-manager.service.ts","../../../projects/ui-common/google-maps/google-maps.service.ts","../../../projects/ui-common/google-maps/map-controls-service.ts","../../../projects/ui-common/google-maps/google-maps-controls.service.ts","../../../projects/ui-common/google-maps/google-maps-recenter-button-control/google-maps-recenter-button-control.component.ts","../../../projects/ui-common/google-maps/google-maps-upload-button-control/google-maps-upload-button-control.component.ts","../../../projects/ui-common/google-maps/google-maps/google-maps.component.ts","../../../projects/ui-common/google-maps/google-maps-places-autocomplete/google-maps-places-autocomplete.directive.ts","../../../projects/ui-common/google-maps/google-maps-places-autocomplete/google-maps-places-autocomplete.component.ts","../../../projects/ui-common/google-maps/map-control.component.ts","../../../projects/ui-common/google-maps/map-file-drop/map-file-drop.component.ts","../../../projects/ui-common/google-maps/google-maps.module.ts","../../../projects/ui-common/google-maps/theseam-ui-common-google-maps.ts"],"sourcesContent":["import { coerceBooleanProperty } from '@angular/cdk/coercion'\nimport { NgZone } from '@angular/core'\nimport { Observable } from 'rxjs'\n\nimport { notNullOrUndefined } from '@theseam/ui-common/utils'\nimport booleanContains from '@turf/boolean-contains'\nimport {\n multiPolygon as turfjsMultiPolygon,\n polygon as turfjsPolygon,\n} from '@turf/helpers'\n\nexport enum AppFeaturePropertyName {\n IsSelected = `__app__isSelected`\n}\n\nexport function isAppFeatureProperty(propertyName: string): propertyName is AppFeaturePropertyName {\n return Object.values(AppFeaturePropertyName)\n .findIndex(value => value === propertyName) !== -1\n}\n\nexport function isFeatureSelected(feature: google.maps.Data.Feature): boolean {\n const isSelected = feature.getProperty(AppFeaturePropertyName.IsSelected)\n return coerceBooleanProperty(isSelected)\n}\n\nexport function setFeatureSelected(feature: google.maps.Data.Feature, isSelected: boolean): void {\n feature.setProperty(AppFeaturePropertyName.IsSelected, isSelected)\n}\n\n// TODO: Check performance of cloning a google.maps.Data instance, so the\n// properties can be removed with the google maps api, instead of on the\n// resulting json.\nexport function stripAppFeaturePropertiesFromJson(json: any) {\n if (notNullOrUndefined(json) && Array.isArray(json?.features)) {\n for (const feature of json.features) {\n if (notNullOrUndefined(feature?.properties)) {\n for (const k of Object.keys(feature.properties)) {\n if (isAppFeatureProperty(k)) {\n feature.properties[k] = undefined\n delete feature.properties[k]\n }\n }\n }\n }\n }\n}\n\n/**\n * Searches for a Feature in Data that contains the provided Feature and can use\n * it as a cutout area.\n */\nexport function getPossibleExteriorFeature(\n data: google.maps.Data,\n feature: google.maps.Data.Feature\n): google.maps.Data.Feature | undefined {\n let exteriorPolygonFeature: google.maps.Data.Feature | undefined\n data.forEach(f => {\n if (f !== feature && (f.getGeometry().getType() === 'Polygon' && featureContains(f, feature))) {\n exteriorPolygonFeature = f\n }\n })\n return exteriorPolygonFeature\n}\n\nexport function addInnerFeatureCutoutToExteriorFeature(\n exteriorFeature: google.maps.Data.Feature,\n innerFeature: google.maps.Data.Feature\n): void {\n // NOTE: Other geometries may support cutouts, but our map shapes editor only\n // supports polygons currently, so we will need to handle other geometry types\n // here if we start allowing users to draw shapes other than polygon.\n if (exteriorFeature.getGeometry().getType() !== 'Polygon' || innerFeature.getGeometry().getType() !== 'Polygon') {\n throw Error(`Inner cutout is only supported by Polygon gemoetry.`)\n }\n\n const featurePolygon = innerFeature.getGeometry() as google.maps.Data.Polygon\n const exteriorPolygon = exteriorFeature.getGeometry() as google.maps.Data.Polygon\n exteriorFeature.setGeometry(new google.maps.Data.Polygon([\n ...exteriorPolygon.getArray(),\n featurePolygon.getAt(0).getArray().reverse()\n ]))\n}\n\n/**\n * Google maps paths don't always start and stop at the exact same position, so\n * this will fix that for turfjs.\n */\nexport function fixPathDifferentStartingAndEndingPoint(coordinates: number[][]): void {\n if (coordinates.length <= 1) {\n return\n }\n\n const start = coordinates[0]\n const end = coordinates[coordinates.length - 1]\n if (start[0] === end[0] && start[1] === end[1]) {\n return\n }\n\n coordinates.push(coordinates[0])\n}\n\nexport function polygonHasValidPathsLengths(polygon: google.maps.Polygon, minPointsInValidPath: number = 3): boolean {\n const paths = polygon.getPaths().getArray()\n for (const path of paths) {\n if (path.getLength() < minPointsInValidPath) {\n return false\n }\n }\n return true\n}\n\nexport function polygonCoordinates(polygon: google.maps.Data.Polygon): number[][][] {\n return polygon.getArray().map(linRing => {\n const coords = linRing.getArray().map(x => [ x.lng(), x.lat() ])\n fixPathDifferentStartingAndEndingPoint(coords)\n return coords\n })\n}\n\nexport function multiPolygonCoordinates(multiPolygon: google.maps.Data.MultiPolygon): number[][][][] {\n return multiPolygon.getArray().map(x => polygonCoordinates(x))\n}\n\nexport function toTurfJsPolygon(polygon: google.maps.Data.Polygon) {\n return turfjsPolygon(polygonCoordinates(polygon))\n}\n\nexport function toTurfJsMultiPolygon(multiPolygon: google.maps.Data.MultiPolygon) {\n return turfjsMultiPolygon(multiPolygonCoordinates(multiPolygon))\n}\n\nexport function toTurfJsFeature(googleFeature: google.maps.Data.Feature) {\n if (googleFeature.getGeometry().getType() === 'Polygon') {\n return toTurfJsPolygon(googleFeature.getGeometry() as google.maps.Data.Polygon)\n } else if (googleFeature.getGeometry().getType() === 'MultiPolygon') {\n return toTurfJsMultiPolygon(googleFeature.getGeometry() as google.maps.Data.MultiPolygon)\n }\n\n throw Error(`Unexpected geometry.`)\n}\n\nexport function featureContains(featureA: google.maps.Data.Feature, featureB: google.maps.Data.Feature): boolean {\n const polygonA = toTurfJsFeature(featureA)\n const polygonB = toTurfJsFeature(featureB)\n return booleanContains(polygonA, polygonB)\n}\n\nexport function createDataFeatureFromPolygon(polygon: google.maps.Polygon): google.maps.Data.Feature {\n const arr = polygon.getPaths().getArray().map(x => x.getArray())\n return new google.maps.Data.Feature({\n geometry: new google.maps.Data.Polygon(arr)\n })\n}\n\nexport function getBoundsWithAllFeatures(data: google.maps.Data): google.maps.LatLngBounds {\n const bounds = new google.maps.LatLngBounds()\n\n data.forEach(feature => {\n const geometry = feature.getGeometry()\n geometry.forEachLatLng(latLng => {\n bounds.extend(latLng)\n })\n })\n\n return bounds\n}\n\nexport function getFeatureBounds(feature: google.maps.Data.Feature): google.maps.LatLngBounds {\n const bounds = new google.maps.LatLngBounds()\n\n const geometry = feature.getGeometry()\n geometry.forEachLatLng(latLng => {\n bounds.extend(latLng)\n })\n\n return bounds\n}\n\nexport function getFeatureCenter(feature: google.maps.Data.Feature): google.maps.LatLng {\n return getFeatureBounds(feature).getCenter()\n}\n\nexport function removeAllFeatures(data: google.maps.Data): void {\n data.forEach(f => data.remove(f))\n}\n\nexport function getFeaturesCount(data: google.maps.Data): number {\n let count = 0\n data.forEach(() => count++)\n return count\n}\n\n/**\n * NOTE: Original events are not emitted, because filtering may omit events.\n */\nexport function createFeatureChangeObservable(data: google.maps.Data, ngZone: NgZone): Observable<void> {\n return new Observable<void>(subscriber => {\n const listeners: google.maps.MapsEventListener[] = []\n\n ngZone.runOutsideAngular(() => {\n listeners.push(data.addListener('setgeometry', (event: google.maps.Data.SetGeometryEvent) => {\n ngZone.run(() => { subscriber.next(undefined) })\n }))\n\n listeners.push(data.addListener('addfeature', (event: google.maps.Data.AddFeatureEvent) => {\n ngZone.run(() => { subscriber.next(undefined) })\n }))\n\n listeners.push(data.addListener('removefeature', (event: google.maps.Data.RemoveFeatureEvent) => {\n ngZone.run(() => { subscriber.next(undefined) })\n }))\n\n listeners.push(data.addListener('setproperty', (event: google.maps.Data.SetPropertyEvent) => {\n if (!isAppFeatureProperty(event.name)) {\n ngZone.run(() => { subscriber.next(undefined) })\n }\n }))\n\n listeners.push(data.addListener('removeproperty', (event: google.maps.Data.RemovePropertyEvent) => {\n if (!isAppFeatureProperty(event.name)) {\n ngZone.run(() => { subscriber.next(undefined) })\n }\n }))\n })\n\n return () => {\n listeners.forEach(google.maps.event.removeListener)\n }\n })\n}\n","import { ESCAPE } from '@angular/cdk/keycodes'\nimport { NgZone, ViewContainerRef } from '@angular/core'\nimport { fromEvent, Subject } from 'rxjs'\nimport { takeUntil } from 'rxjs/operators'\n\nimport { MenuComponent } from '@theseam/ui-common/menu'\n\nimport { isFeatureSelected } from './google-maps-feature-helpers'\n\n// TODO: Close on map losing focus.\n\nexport class GoogleMapsContextMenu {\n\n private readonly _overlayView: google.maps.OverlayView\n private readonly _cleanupFn: () => void\n\n constructor(\n private readonly _map: google.maps.Map,\n private readonly _menu: MenuComponent,\n _position: google.maps.LatLng,\n private readonly _vcr: ViewContainerRef,\n private readonly _ngZone: NgZone,\n private readonly _data: google.maps.Data,\n private readonly _feature: google.maps.Data.Feature,\n ) {\n const tplRef = this._menu.templateRef\n if (tplRef === undefined || tplRef === null) {\n throw Error(`Menu template is not defined.`)\n }\n\n const ref = this._vcr.createEmbeddedView(tplRef)\n ref.detectChanges()\n\n const listeners: google.maps.MapsEventListener[] = []\n const ngUnsubscribe = new Subject<void>()\n\n // TODO: Fix the initial focus. setTimeout avoids the wrong contextmenu\n // getting triggered, but the first item flashes and looks off this way.\n setTimeout(() => {\n this._menu.focusFirstItem('program')\n })\n this._menu.closed.pipe(\n takeUntil(ngUnsubscribe)\n ).subscribe(v => {\n this.close()\n })\n\n fromEvent(document, 'keydown').pipe(\n takeUntil(ngUnsubscribe)\n ).subscribe((event: any) => {\n if (event.keyCode === ESCAPE) {\n this.close()\n }\n })\n\n const __cleanup = () => this._cleanupFn()\n class GoogleMapsContextMenuOverlayView extends google.maps.OverlayView {\n public containerDiv: HTMLDivElement\n\n constructor(\n public position: google.maps.LatLng,\n content: HTMLElement\n ) {\n super()\n this.position = position\n\n this.containerDiv = document.createElement('div')\n this.containerDiv.style.cursor = 'auto'\n this.containerDiv.style.height = '0',\n this.containerDiv.style.position = 'absolute'\n this.containerDiv.appendChild(content)\n\n // Optionally stop clicks, etc., from bubbling up to the map.\n GoogleMapsContextMenuOverlayView.preventMapHitsAndGesturesFrom(this.containerDiv)\n }\n\n /** Called when the view is added to the map. */\n onAdd() {\n // tslint:disable-next-line: no-non-null-assertion\n this.getPanes()!.floatPane.appendChild(this.containerDiv)\n }\n\n /** Called when the view is removed from the map. */\n onRemove() {\n if (this.containerDiv.parentElement) {\n this.containerDiv.parentElement.removeChild(this.containerDiv)\n }\n __cleanup()\n }\n\n /** Called each frame when the view needs to draw itself. */\n draw() {\n // tslint:disable-next-line: no-non-null-assertion\n const divPosition = this.getProjection().fromLatLngToDivPixel(this.position)!\n\n // Hide the popup when it is far out of view.\n const display =\n Math.abs(divPosition.x) < 4000 && Math.abs(divPosition.y) < 4000\n ? 'block'\n : 'none'\n\n if (display === 'block') {\n this.containerDiv.style.left = divPosition.x + 'px'\n this.containerDiv.style.top = divPosition.y + 'px'\n }\n\n if (this.containerDiv.style.display !== display) {\n this.containerDiv.style.display = display\n }\n }\n }\n\n this._overlayView = new GoogleMapsContextMenuOverlayView(_position, ref.rootNodes[0])\n this._overlayView.setMap(this._map)\n\n this._ngZone.runOutsideAngular(() => {\n listeners.push(this._data.addListener('removefeature', (event: google.maps.Data.RemoveFeatureEvent) => {\n if (event.feature === this._feature) {\n this._ngZone.run(() => { this.close() })\n }\n }))\n\n listeners.push(this._data.addListener('setproperty', (event: google.maps.Data.SetPropertyEvent) => {\n if (event.feature === this._feature && !isFeatureSelected(this._feature)) {\n this._ngZone.run(() => { this.close() })\n }\n }))\n\n listeners.push(this._data.addListener('removeproperty', (event: google.maps.Data.RemovePropertyEvent) => {\n if (event.feature === this._feature && !isFeatureSelected(this._feature)) {\n this._ngZone.run(() => { this.close() })\n }\n }))\n\n listeners.push(this._map.addListener('click', (event: google.maps.MapMouseEvent | google.maps.IconMouseEvent) => {\n this._ngZone.run(() => { this.close() })\n }))\n\n listeners.push(this._data.addListener('click', (event: google.maps.Data.MouseEvent) => {\n this._ngZone.run(() => { this.close() })\n }))\n })\n\n this._cleanupFn = () => {\n ngUnsubscribe.next()\n ngUnsubscribe.complete()\n listeners.forEach(google.maps.event.removeListener)\n }\n }\n\n public close(): void {\n this._overlayView.setMap(null)\n }\n\n}\n","import { Injectable } from '@angular/core'\nimport { Observable, Subject } from 'rxjs'\n\nexport enum MapValueSource {\n Input = 'input',\n FeatureChange = 'featurechange'\n}\n\nexport type MapValue = object | undefined | null\n\nexport interface MapValueChange {\n value: MapValue\n source: MapValueSource\n}\n\n@Injectable()\nexport class MapValueManagerService {\n\n private readonly _valueChangedSubject = new Subject<MapValueChange>()\n\n private _value: MapValue\n\n public readonly valueChanged: Observable<MapValueChange>\n\n constructor() {\n this.valueChanged = this._valueChangedSubject.asObservable()\n }\n\n public setValue(value: MapValue, source: MapValueSource): boolean {\n if (value === this._value) {\n return false\n }\n\n if (value === null || value === undefined) {\n this._value = value\n const _change: MapValueChange = {\n source,\n value: this._value,\n }\n this._valueChangedSubject.next(_change)\n return true\n }\n\n if (JSON.stringify(value) === JSON.stringify(this._value)) {\n return true\n }\n\n // TODO: Validate object is valid geojson.\n this._value = value\n const change: MapValueChange = {\n source,\n value: this._value,\n }\n this._valueChangedSubject.next(change)\n return true\n }\n\n public get value(): MapValue {\n return this._value\n }\n\n}\n","import { Injectable, NgZone, OnDestroy, ViewContainerRef } from '@angular/core'\nimport { BehaviorSubject, from, Observable, Subject } from 'rxjs'\nimport { switchMap, takeUntil, tap } from 'rxjs/operators'\n\nimport { MenuComponent } from '@theseam/ui-common/menu'\nimport { isNullOrUndefined, notNullOrUndefined } from '@theseam/ui-common/utils'\n\nimport { GoogleMapsContextMenu } from './google-maps-contextmenu'\nimport {\n addInnerFeatureCutoutToExteriorFeature,\n createDataFeatureFromPolygon,\n createFeatureChangeObservable,\n getBoundsWithAllFeatures,\n getFeatureCenter,\n getFeaturesCount,\n getPossibleExteriorFeature,\n isFeatureSelected,\n polygonHasValidPathsLengths,\n removeAllFeatures,\n setFeatureSelected,\n stripAppFeaturePropertiesFromJson,\n} from './google-maps-feature-helpers'\nimport { MapValueManagerService, MapValueSource } from './map-value-manager.service'\n\ndeclare const ngDevMode: boolean | undefined\n\nconst DEFAULT_POLYGON_OPTIONS: google.maps.PolygonOptions = {\n clickable: true,\n draggable: true,\n editable: true,\n // fillColor: 'rgba(60,150,60,1)',\n // strokeColor: 'rgba(155,255,0,1)'\n}\n\nconst DEFAULT_DRAWING_MANAGER_OPTIONS: (() => google.maps.drawing.DrawingManagerOptions) = () => ({\n drawingControl: true,\n drawingControlOptions: {\n drawingModes: [\n google.maps.drawing.OverlayType.POLYGON\n ]\n },\n polygonOptions: DEFAULT_POLYGON_OPTIONS,\n drawingMode: null\n})\n\nconst FEATURE_STYLE_OPTIONS_DEFAULT: google.maps.Data.StyleOptions = {\n clickable: true,\n visible: true,\n // zIndex?: number;\n\n // cursor?: string;\n draggable: false,\n editable: false,\n fillColor: 'teal',\n fillOpacity: 0.3,\n strokeColor: 'blue',\n strokeOpacity: 1,\n strokeWeight: 2,\n}\n\nconst FEATURE_STYLE_OPTIONS_SELECTED: google.maps.Data.StyleOptions = {\n ...FEATURE_STYLE_OPTIONS_DEFAULT,\n draggable: true,\n editable: true,\n fillColor: 'green',\n fillOpacity: 0.7,\n strokeColor: 'limegreen',\n strokeOpacity: 1,\n strokeWeight: 2,\n}\n\ntype WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] }\n\n@Injectable()\nexport class GoogleMapsService implements OnDestroy {\n private readonly _ngUnsubscribe = new Subject<void>()\n\n private readonly _mapReadySubject = new BehaviorSubject<boolean>(false)\n\n private _drawingManager?: google.maps.drawing.DrawingManager\n private _featureContextMenu: MenuComponent | null = null\n private _activeContextMenu: GoogleMapsContextMenu | null = null\n private _baseLatLng?: google.maps.LatLngLiteral\n\n private _allowDrawingHoleInPolygon: boolean = false\n\n // TODO: Move to a better place than the map wrapper service.\n private _fileInputHandler: ((file: File) => void) | undefined | null\n\n public googleMap?: google.maps.Map\n\n public readonly mapReady$: Observable<boolean>\n\n public get mapReady(): boolean { return this._mapReadySubject.value }\n\n constructor(\n private readonly _mapValueManager: MapValueManagerService,\n private readonly _ngZone: NgZone,\n private readonly _vcr: ViewContainerRef,\n ) {\n this.mapReady$ = this._mapReadySubject.asObservable()\n }\n\n ngOnDestroy(): void {\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n\n public setMap(map: google.maps.Map): void {\n this.googleMap = map\n this._mapReadySubject.next(true)\n this._initDrawingManager()\n this._initFeatureStyling()\n this._initFeatureChangeListeners()\n }\n\n public setBaseLatLng(lat: number, lng: number): void {\n this._baseLatLng = { lat, lng }\n }\n\n // TODO: Refactor out of the service meant to just wrap the google maps api.\n public setFeatureContextMenu(menu: MenuComponent | null): void {\n this._featureContextMenu = menu\n }\n\n public getDiv(): HTMLDivElement {\n this._assertInitialized()\n return this.googleMap.getDiv() as HTMLDivElement\n }\n\n public fitBounds(bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral, padding?: number | google.maps.Padding): void {\n this._assertInitialized()\n this.googleMap.fitBounds(bounds, padding)\n }\n\n /**\n * Iterates the map's features and removes any that are selected.\n */\n public deleteSelection(): void {\n this._assertInitialized()\n const mapData = this.googleMap.data\n mapData.forEach(f => {\n if (isFeatureSelected(f)) {\n mapData.remove(f)\n }\n })\n }\n\n /**\n * Stops the current drawing.\n */\n public stopDrawing(): void {\n this._ngZone.runOutsideAngular(() => {\n if (isNullOrUndefined(this._drawingManager) || this._drawingManager.getDrawingMode() === null) {\n return\n }\n\n // Listening for the completion event of the overlay currently being drawn\n // and removing it. I haven't found a way to cancel the current drawing,\n // without this hack that assumes our listeners will not run into a race\n // condition.\n const listener = google.maps.event.addListener(\n this._drawingManager,\n 'overlaycomplete',\n (event: google.maps.drawing.OverlayCompleteEvent) => {\n event.overlay.setMap(null)\n listener.remove()\n }\n )\n\n // To fake canceling the current drawing, without disabling the drawing\n // mode, the drawin mode is being unset then immediately set back. When\n // the mode is unset the 'overlaycomplete' event will fire, which will\n // give a reference to the current overlay to remove, then it is set back\n // to the mode the user was using. To the user is should just seem like\n // the current drawing was canceled and they can start drawing again.\n const mode = this._drawingManager.getDrawingMode()\n this._drawingManager.setDrawingMode(null)\n this._drawingManager.setDrawingMode(mode)\n\n // 'overlaycomplete' should fire immediately, unless an overlay hadn't\n // started drawing. This timeout will make sure the listener gets removed.\n setTimeout(() => {\n listener.remove()\n })\n\n })\n }\n\n private _initDrawingManager(): void {\n if (notNullOrUndefined(this._drawingManager)) {\n throw Error(`DrawingManager is already initialized.`)\n }\n\n this._assertInitialized()\n\n const options = DEFAULT_DRAWING_MANAGER_OPTIONS()\n\n const drawingManager = new google.maps.drawing.DrawingManager(options)\n drawingManager.setMap(this.googleMap)\n\n this._drawingManager = drawingManager\n\n this._drawingManager.addListener('drawingmode_changed', event => {\n if (this._drawingManager?.getDrawingMode() !== null) {\n this._assertInitialized()\n this.googleMap.data.forEach(f => {\n if (isFeatureSelected(f)) {\n setFeatureSelected(f, false)\n }\n })\n }\n })\n }\n\n public addControl(element: HTMLElement, position: google.maps.ControlPosition): void {\n this._assertInitialized()\n this.googleMap.controls[position].push(element)\n }\n\n public async setData(data: any): Promise<void> {\n this._assertInitialized()\n removeAllFeatures(this.googleMap.data)\n this.googleMap.data.addGeoJson(data)\n this.googleMap.fitBounds(getBoundsWithAllFeatures(this.googleMap.data))\n }\n\n // TODO: Refactor out of the service meant to just wrap the google maps api.\n public reCenterOnFeatures(): void {\n this._assertInitialized()\n if (getFeaturesCount(this.googleMap.data) === 0) {\n if (!this._baseLatLng) {\n return\n }\n\n this.googleMap.panTo(this._baseLatLng)\n return\n }\n this.googleMap.fitBounds(getBoundsWithAllFeatures(this.googleMap.data))\n\n // TODO: Fix to pan to center. Currently fitBounds results in the expected\n // result, but pantToBounds animates.\n // this.googleMap.panToBounds(getBoundsWithAllFeatures(this.googleMap.data))\n }\n\n public allowDrawingHoleInPolygon(allow: boolean): void {\n this._allowDrawingHoleInPolygon = allow\n }\n\n public setFileInputHandler(handler: ((file: File) => void) | undefined | null): void {\n this._fileInputHandler = handler\n }\n\n public getFileInputHandler(): ((file: File) => void) | undefined | null {\n return this._fileInputHandler\n }\n\n private _initFeatureStyling(): void {\n this._assertInitialized()\n\n // Disable any selection when clicking the map.\n //\n // TODO: There may be a better way to do this that would be more accurate or\n // additional events that should be listened to, such as the disabling\n // selection when the map looses focus.\n this.googleMap.addListener('click', (even: google.maps.MapMouseEvent | google.maps.IconMouseEvent) => {\n this._assertInitialized()\n this.googleMap.data.forEach(f => setFeatureSelected(f, false))\n })\n\n // Determine what the style of the features are.\n this.googleMap.data.setStyle((feature) => {\n if (isFeatureSelected(feature)) {\n return FEATURE_STYLE_OPTIONS_SELECTED\n }\n\n return FEATURE_STYLE_OPTIONS_DEFAULT\n })\n\n // Select a feature when clicked.\n this.googleMap.data.addListener('click', (event: google.maps.Data.MouseEvent) => {\n this._assertInitialized()\n\n setFeatureSelected(event.feature, true)\n this.googleMap.data.forEach(f => {\n if (f !== event.feature && isFeatureSelected(f)) {\n setFeatureSelected(f, false)\n }\n })\n })\n\n // Set a style on hovered features that can be selected.\n this.googleMap.data.addListener('mouseover', (event: google.maps.Data.MouseEvent) => {\n this._assertInitialized()\n this.googleMap.data.revertStyle()\n if (!this.isDrawing() && !isFeatureSelected(event.feature)) {\n this.googleMap.data.overrideStyle(event.feature, { strokeWeight: 4 })\n }\n })\n\n // Remove any hover styles when mouse moves away.\n this.googleMap.data.addListener('mouseout', (event: google.maps.Data.MouseEvent) => {\n this._assertInitialized()\n this.googleMap.data.revertStyle()\n })\n }\n\n private _initFeatureChangeListeners(): void {\n this._assertInitialized()\n\n createFeatureChangeObservable(this.googleMap.data, this._ngZone).pipe(\n switchMap(() => from(this.getGeoJson()).pipe(\n tap(geoJson => this._mapValueManager.setValue(geoJson, MapValueSource.FeatureChange)),\n )),\n takeUntil(this._ngUnsubscribe),\n ).subscribe()\n\n this.googleMap.data.addListener('contextmenu', (event: google.maps.Data.MouseEvent) => {\n if (!isFeatureSelected(event.feature)) {\n return\n }\n\n this._openContextMenuForFeature(event.feature, event.latLng)\n })\n\n if (notNullOrUndefined(this._drawingManager)) {\n google.maps.event.addListener(this._drawingManager, 'polygoncomplete', (polygon: google.maps.Polygon) => {\n // The DrawingManager doesn't seem to have a way to access the overlays,\n // so if the map is not set then it shouldn'y be considered a successful\n // completion. I am canceling the active drawing by disabling drawing\n // mode and setting the map null in the 'overlaycomplete' event, which\n // fires before the 'polygoncomplete' event.\n if (isNullOrUndefined(polygon.getMap())) {\n return\n }\n\n this._assertInitialized()\n\n // TODO: See if there is a way to prevent the polygon from completing\n // without enough points. This is very low priority, because starting\n // over after adding a single point isn't a major inconvenience.\n if (!polygonHasValidPathsLengths(polygon)) {\n // Remove the drawn polygon.\n polygon.setMap(null)\n // Stop drawing.\n this._drawingManager?.setDrawingMode(null)\n return\n }\n\n // Create a map feature of the drawn polygon.\n const feature = createDataFeatureFromPolygon(polygon)\n // Remove the drawn polygon.\n polygon.setMap(null)\n\n // Stop drawing.\n this._drawingManager?.setDrawingMode(null)\n\n // Check if the feature should be used as a cutout to an existing\n // feature or added as it's own feature.\n const exteriorPolygonFeature = this._allowDrawingHoleInPolygon\n ? getPossibleExteriorFeature(this.googleMap.data, feature)\n : undefined\n if (exteriorPolygonFeature) {\n addInnerFeatureCutoutToExteriorFeature(exteriorPolygonFeature, feature)\n setFeatureSelected(exteriorPolygonFeature, true)\n } else {\n this.googleMap.data.add(feature)\n setFeatureSelected(feature, true)\n }\n })\n }\n }\n\n public isDrawing(): boolean {\n if (isNullOrUndefined(this._drawingManager)) {\n return true\n }\n\n return this._drawingManager.getDrawingMode() !== null\n }\n\n // TODO: Refactor out of the service meant to just wrap the google maps api.\n public hasSelectedFeature(): boolean {\n this._assertInitialized()\n let isSelected = false\n this.googleMap.data.forEach(f => {\n if (isFeatureSelected(f)) {\n isSelected = true\n }\n })\n return isSelected\n }\n\n // TODO: Refactor out of the service meant to just wrap the google maps api.\n public getSelectedFeature(): google.maps.Data.Feature | null {\n this._assertInitialized()\n let feature: google.maps.Data.Feature | null = null\n this.googleMap.data.forEach(f => {\n if (isFeatureSelected(f)) {\n feature = f\n }\n })\n return feature\n }\n\n // TODO: Refactor out of the service meant to just wrap the google maps api.\n public openContextMenu(): void {\n const feature = this.getSelectedFeature()\n if (feature) {\n this._openContextMenuForFeature(feature)\n }\n }\n\n // TODO: Refactor out of the service meant to just wrap the google maps api.\n private _openContextMenuForFeature(feature: google.maps.Data.Feature, position?: google.maps.LatLng) {\n if (this._activeContextMenu) {\n this._activeContextMenu.close()\n this._activeContextMenu = null\n }\n\n this._assertInitialized()\n\n let _position = position\n if (!_position) {\n _position = getFeatureCenter(feature)\n }\n if (this._featureContextMenu) {\n this._activeContextMenu = new GoogleMapsContextMenu(\n this.googleMap,\n this._featureContextMenu,\n _position,\n this._vcr,\n this._ngZone,\n this.googleMap.data,\n feature,\n )\n }\n }\n\n public getGeoJson(removeAppProperties: boolean = true): Promise<object> {\n return new Promise((resolve, reject) => {\n this._assertInitialized()\n this.googleMap.data.toGeoJson(f => {\n if (removeAppProperties) {\n stripAppFeaturePropertiesFromJson(f)\n }\n resolve(f)\n })\n })\n }\n\n /** Asserts that the map has been initialized. */\n private _assertInitialized(): asserts this is WithRequired<GoogleMapsService, 'googleMap'> {\n if (!this.googleMap && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error(\n 'Cannot access Google Map information before the API has been initialized. ' +\n 'Please wait for the API to load before trying to interact with it.',\n )\n }\n }\n}\n","import { InjectionToken } from '@angular/core'\n\nimport { ComponentType } from '@theseam/ui-common/models'\n\nexport interface MapControl<TData = any> {\n component: ComponentType<any>\n data?: TData\n position?: google.maps.ControlPosition\n}\n\nexport interface MapControlsService {\n add(control: MapControl): void\n}\n\nexport const MAP_CONTROLS_SERVICE = new InjectionToken<MapControlsService>('MAP_CONTROLS_SERVICE')\n\nexport const MAP_CONTROL_DATA = new InjectionToken<any>('MAP_CONTROL_DATA')\n","import { ComponentFactoryResolver, ComponentRef, Injectable, Injector, StaticProvider } from '@angular/core'\nimport { Observable, Subject } from 'rxjs'\n\nimport { GoogleMapsService } from './google-maps.service'\nimport { MapControl, MapControlsService, MAP_CONTROL_DATA } from './map-controls-service'\n\nexport class MapControlRef {\n\n private readonly _destroyedSubject = new Subject<void>()\n\n private _componentRef: ComponentRef<any>\n private _addedAtPosition: google.maps.ControlPosition\n\n public destroyed: Observable<void>\n\n constructor(\n private readonly _googleMaps: GoogleMapsService,\n private readonly _componentFactoryResolver: ComponentFactoryResolver,\n private readonly _injector: Injector,\n private readonly _controlDef: MapControl\n ) {\n this.destroyed = this._destroyedSubject.asObservable()\n\n const component: any = this._controlDef.component\n const factory = this._componentFactoryResolver.resolveComponentFactory(component)\n\n const providers: StaticProvider[] = []\n if (this._controlDef.data) {\n providers.push({\n provide: MAP_CONTROL_DATA,\n useValue: this._controlDef.data\n })\n }\n const injector = Injector.create({\n providers,\n parent: this._injector,\n })\n\n this._componentRef = factory.create(injector)\n this._componentRef.changeDetectorRef.detectChanges()\n\n const position = this._controlDef.position ?? google.maps.ControlPosition.LEFT_BOTTOM\n\n this._googleMaps.addControl(\n this._componentRef.location.nativeElement,\n position\n )\n\n this._addedAtPosition = position\n }\n\n public destroy() {\n const googleMaps = this._googleMaps.googleMap\n if (googleMaps !== undefined) {\n let idx = -1\n googleMaps.controls[this._addedAtPosition].forEach((elem, index) => {\n if (elem === this._componentRef.location.nativeElement) {\n idx = index\n }\n })\n if (idx === -1) {\n throw Error(`Unable to destroy control. Control not found.`)\n }\n googleMaps.controls[this._addedAtPosition].removeAt(idx)\n }\n this._componentRef.destroy()\n\n this._destroyedSubject.next()\n this._destroyedSubject.complete()\n }\n\n}\n\n@Injectable()\nexport class GoogleMapsControlsService implements MapControlsService {\n\n constructor(\n private readonly _googleMaps: GoogleMapsService,\n private readonly _componentFactoryResolver: ComponentFactoryResolver,\n private readonly _injector: Injector,\n ) { }\n\n public add(control: MapControl): MapControlRef {\n return new MapControlRef(this._googleMaps, this._componentFactoryResolver, this._injector, control)\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n HostListener,\n Inject,\n Input,\n OnDestroy,\n Optional,\n} from '@angular/core'\nimport { Subject } from 'rxjs'\n\nimport { SeamIcon } from '@theseam/ui-common/icon'\n\nimport { GoogleMapsService } from '../google-maps.service'\nimport { MAP_CONTROL_DATA } from '../map-controls-service'\n\nexport interface GoogleMapsRecenterButtonControlData {\n label?: string | undefined | null\n icon?: SeamIcon | undefined | null\n}\n\n/**\n *\n */\n@Component({\n // tslint:disable-next-line: component-selector\n selector: 'button[seam-google-maps-recenter-button-control]',\n templateUrl: './google-maps-recenter-button-control.component.html',\n styleUrls: ['./google-maps-recenter-button-control.component.scss'],\n host: {\n '[attr.draggable]': 'false',\n '[attr.aria-label]': 'label',\n '[attr.title]': 'label',\n 'type': 'button',\n 'class': 'gmnoprint gm-control-active'\n },\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TheSeamGoogleMapsRecenterButtonControlComponent implements OnDestroy {\n\n private readonly _ngUnsubscribe = new Subject<void>()\n\n private _listeners: (() => void)[] = []\n\n @Input() label: string | undefined | null\n\n @Input() icon: SeamIcon | undefined | null\n\n @HostListener('click', [ 'event' ])\n _onClick(event: MouseEvent) {\n this._googleMaps.reCenterOnFeatures()\n }\n\n constructor(\n private readonly _googleMaps: GoogleMapsService,\n @Optional() @Inject(MAP_CONTROL_DATA) _data?: GoogleMapsRecenterButtonControlData\n ) {\n if (_data) {\n if (_data.hasOwnProperty('label')) {\n this.label = _data.label\n }\n if (_data.hasOwnProperty('icon')) {\n this.icon = _data.icon\n }\n }\n }\n\n /** @ignore */\n ngOnDestroy() {\n this._listeners.forEach(l => l())\n\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostListener,\n Inject,\n Input,\n OnDestroy,\n Optional,\n Renderer2,\n} from '@angular/core'\nimport { Subject } from 'rxjs'\n\nimport { SeamIcon } from '@theseam/ui-common/icon'\nimport { readGeoFile } from '@theseam/ui-common/utils'\n\nimport { GoogleMapsService } from '../google-maps.service'\nimport { MAP_CONTROL_DATA } from '../map-controls-service'\nimport { MapValueManagerService, MapValueSource } from '../map-value-manager.service'\n\nexport interface GoogleMapsUploadButtonControlData {\n label?: string | undefined | null\n icon?: SeamIcon | undefined | null\n}\n\n/**\n *\n */\n@Component({\n // tslint:disable-next-line: component-selector\n selector: 'button[seam-google-maps-upload-button-control]',\n templateUrl: './google-maps-upload-button-control.component.html',\n styleUrls: ['./google-maps-upload-button-control.component.scss'],\n host: {\n '[attr.draggable]': 'false',\n '[attr.aria-label]': 'label',\n '[attr.title]': 'label',\n 'type': 'button',\n 'class': 'gmnoprint gm-control-active'\n },\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TheSeamGoogleMapsUploadButtonControlComponent implements OnDestroy {\n\n private readonly _ngUnsubscribe = new Subject<void>()\n\n private readonly _fileInputElement: HTMLInputElement\n\n private _listeners: (() => void)[] = []\n\n @Input() label: string | undefined | null\n\n @Input() icon: SeamIcon | undefined | null\n\n @HostListener('click', [ 'event' ])\n _onClick(event: MouseEvent) {\n this._fileInputElement.click()\n }\n\n constructor(\n private readonly _elementRef: ElementRef,\n private readonly _mapValueManager: MapValueManagerService,\n private readonly _renderer: Renderer2,\n private readonly _googleMaps: GoogleMapsService,\n @Optional() @Inject(MAP_CONTROL_DATA) _data?: GoogleMapsUploadButtonControlData\n ) {\n if (_data) {\n if (_data.hasOwnProperty('label')) {\n this.label = _data.label\n }\n if (_data.hasOwnProperty('icon')) {\n this.icon = _data.icon\n }\n }\n\n this._fileInputElement = this._createHiddenInput()\n this._renderer.appendChild(this._elementRef.nativeElement, this._fileInputElement)\n }\n\n /** @ignore */\n ngOnDestroy() {\n this._listeners.forEach(l => l())\n\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n\n private _getFile(throwIfInvalidFiles: boolean = true): File | null {\n const files = this._fileInputElement.files\n if (files === null || files.length === 0) {\n return null\n }\n\n if (throwIfInvalidFiles) {\n if (files.length > 1) {\n throw Error(`Only one file can be imported at a time.`)\n }\n }\n\n return files[0]\n }\n\n private async _importFile(file: File): Promise<void> {\n const json = await readGeoFile(file)\n this._mapValueManager.setValue(json, MapValueSource.Input)\n this._resetInput()\n }\n\n private _createHiddenInput(): HTMLInputElement {\n const fileInputElement = this._renderer.createElement('input')\n this._renderer.setAttribute(fileInputElement, 'type', 'file')\n this._renderer.setAttribute(fileInputElement, 'hidden', '')\n this._renderer.setAttribute(fileInputElement, 'accept', '.json,.geojson,.shp,.zip')\n\n this._listeners.push(this._renderer.listen(fileInputElement, 'change', (event: Event) => {\n const file = this._getFile()\n if (file === null) { return }\n const fileImportHandler = this._googleMaps.getFileInputHandler()\n if (fileImportHandler) {\n fileImportHandler(file)\n } else {\n this._importFile(file)\n }\n }))\n\n return fileInputElement\n }\n\n private _createTemporaryFormElement(): HTMLFormElement {\n return this._renderer.createElement('form')\n }\n\n /**\n * Reset input element, so that the same file can be added again.\n */\n private _resetInput(): void {\n const formElement = this._createTemporaryFormElement()\n this._renderer.appendChild(formElement, this._fileInputElement)\n formElement.reset()\n this._renderer.appendChild(this._elementRef.nativeElement, this._fileInputElement)\n }\n}\n","import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y'\nimport { BooleanInput, coerceNumberProperty, NumberInput } from '@angular/cdk/coercion'\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n forwardRef,\n HostBinding,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n SimpleChanges,\n ViewChild,\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\nimport { fromEvent, Subject } from 'rxjs'\nimport { takeUntil, tap } from 'rxjs/operators'\n\nimport { AgmMap } from '@agm/core'\nimport { faCrosshairs, faFileImport } from '@fortawesome/free-solid-svg-icons'\nimport { CanDisable, CanDisableCtor, InputBoolean, InputNumber, mixinDisabled } from '@theseam/ui-common/core'\nimport { MenuComponent } from '@theseam/ui-common/menu'\n\nimport { FeatureCollection } from 'geojson'\nimport { GoogleMapsControlsService } from '../google-maps-controls.service'\nimport { TheSeamGoogleMapsRecenterButtonControlComponent } from '../google-maps-recenter-button-control/google-maps-recenter-button-control.component'\nimport { TheSeamGoogleMapsUploadButtonControlComponent } from '../google-maps-upload-button-control/google-maps-upload-button-control.component'\nimport { GoogleMapsService } from '../google-maps.service'\nimport { MapControl, MAP_CONTROLS_SERVICE } from '../map-controls-service'\nimport { MapValue, MapValueManagerService, MapValueSource } from '../map-value-manager.service'\n\nclass TheSeamGoogleMapsComponentBase {\n constructor(public _elementRef: ElementRef) {}\n}\n\nconst _TheSeamGoogleMapsMixinBase: CanDisableCtor &\n typeof TheSeamGoogleMapsComponentBase =\n mixinDisabled(TheSeamGoogleMapsComponentBase)\n\n/**\n * A wrapper for googlemap.\n */\n@Component({\n selector: 'seam-google-maps',\n templateUrl: './google-maps.component.html',\n styleUrls: ['./google-maps.component.scss'],\n inputs: [\n 'disabled'\n ],\n providers: [\n MapValueManagerService,\n GoogleMapsService,\n { provide: MAP_CONTROLS_SERVICE, useClass: GoogleMapsControlsService },\n {\n provide: NG_VALUE_ACCESSOR,\n // tslint:disable-next-line: no-use-before-declare\n useExisting: forwardRef(() => TheSeamGoogleMapsComponent),\n multi: true\n }\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n exportAs: 'seamGoogleMaps'\n})\nexport class TheSeamGoogleMapsComponent extends _TheSeamGoogleMapsMixinBase\n implements OnInit, AfterViewInit, OnDestroy, OnChanges, CanDisable, ControlValueAccessor {\n static ngAcceptInputType_disabled: BooleanInput\n static ngAcceptInputType_zoom: NumberInput\n static ngAcceptInputType_longitude: NumberInput\n static ngAcceptInputType_latitude: NumberInput\n static ngAcceptInputType_fileDropEnabled: BooleanInput\n static ngAcceptInputType_fileUploadControlEnabled: BooleanInput\n static ngAcceptInputType_fullscreenControlEnabled: BooleanInput\n static ngAcceptInputType_reCenterControlEnabled: BooleanInput\n static ngAcceptInputType_mapTypeControlEnabled: BooleanInput\n static ngAcceptInputType_streetViewControlEnabled: BooleanInput\n static ngAcceptInputType_allowDrawingHoleInPolygon: BooleanInput\n\n private readonly _ngUnsubscribe = new Subject<void>()\n\n readonly _fileUploadControlDef: MapControl = {\n component: TheSeamGoogleMapsUploadButtonControlComponent,\n data: { label: 'Import Geo File', icon: faFileImport },\n position: 6 /* google.maps.ControlPosition.LEFT_BOTTOM */,\n }\n\n readonly _reCenterControlDef: MapControl = {\n component: TheSeamGoogleMapsRecenterButtonControlComponent,\n data: { label: 'Center on Field', icon: faCrosshairs },\n position: 9 /* google.maps.ControlPosition.RIGHT_BOTTOM */,\n }\n\n private _focusOrigin: FocusOrigin = null\n\n @Input()\n set value(value: MapValue) {\n this._mapValueManager.setValue(value, MapValueSource.Input)\n }\n get value(): MapValue {\n return this._mapValueManager.value\n }\n\n @Input()\n set tabIndex(value: number) { this._tabIndex = coerceNumberProperty(value) }\n get tabIndex(): number { return this._tabIndex }\n /**\n * Set the tab index to `-1` to allow the root element of the\n * component to receive `focus` event from javascript, but not get focused by\n * keyboard navigation.\n */\n private _tabIndex = -1\n\n @Input() @InputBoolean() fileDropEnabled: boolean = true\n\n @Input() @InputBoolean() fileUploadControlEnabled: boolean = false\n @Input() @InputBoolean() fullscreenControlEnabled: boolean = true\n @Input() @InputBoolean() reCenterControlEnabled: boolean = true\n @Input() @InputBoolean() mapTypeControlEnabled: boolean = true\n @Input() @InputBoolean() streetViewControlEnabled: boolean = false\n\n @Input() @InputBoolean() allowDrawingHoleInPolygon: boolean = false\n\n @Input()\n set fileImportHandler(value: ((file: File) => void) | undefined | null) {\n this._googleMaps.setFileInputHandler(value)\n }\n\n @HostBinding('attr.disabled')\n get _attrDisabled() { return this.disabled || null }\n\n @HostBinding('attr.tabindex')\n get _attrTabIndex() { return this.disabled ? -1 : (this.tabIndex || 0) }\n\n onChange: any\n onTouched: any\n\n @Input() @InputNumber() zoom: number = 14\n @Input() @InputNumber() longitude: number = -98.570209\n @Input() @InputNumber() latitude: number = 37.633814\n\n @Output() mapReady = new EventEmitter<void>()\n\n @ViewChild(AgmMap, { static: true }) public agmMap!: AgmMap\n @ViewChild('featureContextMenu', { static: true, read: MenuComponent }) public featureContextMenu!: MenuComponent\n\n @ViewChild(AgmMap, { static: true, read: ElementRef }) public agmMapTpl!: ElementRef<HTMLElement>\n\n constructor(\n elementRef: ElementRef,\n private readonly _focusMonitor: FocusMonitor,\n private readonly _googleMaps: GoogleMapsService,\n private readonly _mapValueManager: MapValueManagerService,\n ) {\n super(elementRef)\n\n this._focusMonitor.monitor(this._elementRef, true).pipe(\n tap(origin => this._focusOrigin = origin),\n takeUntil(this._ngUnsubscribe),\n ).subscribe()\n\n this._mapValueManager.valueChanged.pipe(\n tap(change => {\n if (this.onChange) { this.onChange(change.value) }\n if (this.onTouched) { this.onTouched() }\n }),\n tap(changed => {\n if (this._googleMaps.mapReady && changed.source !== MapValueSource.FeatureChange) {\n this._googleMaps.setData(changed.value)\n }\n }),\n takeUntil(this._ngUnsubscribe),\n ).subscribe()\n\n this._googleMaps.setBaseLatLng(this.latitude, this.longitude)\n }\n\n /** @ignore */\n ngOnInit() {\n this._googleMaps.setFeatureContextMenu(this.featureContextMenu)\n\n fromEvent<KeyboardEvent>(window, 'keydown').pipe(\n tap((event: KeyboardEvent) => {\n switch (event.code) {\n case 'Delete': this._googleMaps.deleteSelection(); event.preventDefault(); event.stopPropagation(); break\n case 'Escape': this._googleMaps.stopDrawing(); event.preventDefault(); event.stopPropagation(); break\n case 'ContextMenu': this._googleMaps.openContextMenu(); event.preventDefault(); event.stopPropagation(); break\n }\n }),\n takeUntil(this._ngUnsubscribe)\n ).subscribe()\n }\n\n /** @ignore */\n ngOnDestroy() {\n this._focusMonitor.stopMonitoring(this._elementRef)\n\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n\n /** @ignore */\n ngAfterViewInit() { }\n\n ngOnChanges(changes: SimpleChanges): void {\n let updateBase = false\n if (changes.hasOwnProperty('latitude')) {\n this.latitude = changes['latitude'].currentValue\n updateBase = true\n }\n if (changes.hasOwnProperty('longitude')) {\n this.longitude = changes['longitude'].currentValue\n updateBase = true\n }\n if (updateBase) {\n this._googleMaps.setBaseLatLng(this.latitude, this.longitude)\n }\n\n if (changes.hasOwnProperty('allowDrawingHoleInPolygon')) {\n this._googleMaps.allowDrawingHoleInPolygon(this.allowDrawingHoleInPolygon)\n }\n }\n\n writeValue(value: MapValue): void {\n this.value = value\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn\n }\n\n registerOnTouched(fn: any): void {\n this.onTouched = fn\n }\n\n setDisabledState?(isDisabled: boolean): void {\n this.disabled = isDisabled\n }\n\n public fitBounds(bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral, padding?: number | google.maps.Padding): void {\n this._googleMaps.fitBounds(bounds, padding)\n }\n\n public getGeoJson(): Promise<object> {\n return this._googleMaps.getGeoJson()\n }\n\n public hasFocus(): boolean {\n return this._focusOrigin !== null && this._focusOrigin !== undefined\n }\n\n /** Focuses the button. */\n public focus(): void {\n this._getHostElement().focus()\n }\n\n private _getHostElement() {\n return this._elementRef.nativeElement\n }\n\n _onMapReady(theMap: google.maps.Map) {\n this._googleMaps.setMap(theMap)\n this._googleMaps.setData(this._mapValueManager.value)\n // NOTE: AgmMap has a race condition problem that causes the input latitude,\n // longitude, and zoom to get ignored, before googlemaps emits\n // 'center_changed'. This should avoid the issue, until we stop using AgmMap\n // or upgrade to a more recent version that may not have the issue anymore.\n this._googleMaps.reCenterOnFeatures()\n this._googleMaps.googleMap?.setZoom(this.zoom)\n }\n\n _onClickDeleteFeature() {\n this._googleMaps.deleteSelection()\n }\n}\n","import { Directive, ElementRef, HostBinding, Input, NgZone, OnChanges, OnDestroy, OnInit, Output, SimpleChanges } from '@angular/core'\nimport { interval, Observable, Subject, Subscriber } from 'rxjs'\nimport { filter, mapTo, startWith, switchMap, take, takeUntil } from 'rxjs/operators'\n\ndeclare const ngDevMode: boolean | undefined\ntype WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] }\n\nexport const SEAM_GOOGLE_PLACES_AUTOCOMPLETE_DEFAULT_OPTIONS: google.maps.places.AutocompleteOptions = {\n componentRestrictions: { country: 'US' }\n}\n\n@Directive({\n selector: 'input[seamGoogleMapsPlacesAutocomplete]',\n exportAs: 'seamGoogleMapsPlacesAutocomplete'\n})\nexport class TheSeamGoogleMapsPlacesAutocompleteDirective implements OnInit, OnDestroy, OnChanges {\n private readonly _autoCompleteReadySubject = new Subject()\n private readonly _ngUnsubscribe = new Subject()\n\n private _placeChangedPending: { observable: Observable<any>, subscriber: Subscriber<any> }[] = []\n private _listeners: google.maps.MapsEventListener[] = []\n\n public autoComplete?: google.maps.places.Autocomplete\n\n @Input()\n set options(value: google.maps.places.AutocompleteOptions | undefined | null) {\n this._options = value || SEAM_GOOGLE_PLACES_AUTOCOMPLETE_DEFAULT_OPTIONS\n }\n private _options: google.maps.places.AutocompleteOptions = SEAM_GOOGLE_PLACES_AUTOCOMPLETE_DEFAULT_OPTIONS\n\n /**\n * This event is fired when a PlaceResult is made available for a Place the\n * user has selected. If the user enters the name of a Place that was not\n * suggested by the control and presses the Enter key, or if a Place Details\n * request fails, the PlaceResult contains the user input in the name\n * property, with no other properties defined.\n *\n * See: https://developers.google.com/maps/documentation/javascript/reference/places-widget#Autocomplete.place_changed\n */\n @Output() readonly placeChanged: Observable<any>\n\n @HostBinding('attr.type') _attrType = 'text'\n\n constructor(\n private readonly _elementRef: ElementRef<HTMLInputElement>,\n private readonly _ngZone: NgZone,\n ) {\n this.placeChanged = this._autoCompleteReadySubject.pipe(\n startWith(undefined),\n switchMap(() => this._createPlaceChangedObservable<any>())\n )\n }\n\n ngOnInit(): void {\n this._ngZone.runOutsideAngular(() => {\n this._untilGoogleMapsApiLoaded().pipe(takeUntil(this._ngUnsubscribe)).subscribe(() => {\n this.autoComplete = new google.maps.places.Autocomplete(this.getHostElement(), this._options)\n\n this._placeChangedPending.forEach(pending => pending.observable.subscribe(pending.subscriber))\n\n this._autoCompleteReadySubject.next()\n })\n })\n }\n\n ngOnDestroy(): void {\n this._listeners.forEach(l => l.remove())\n this._listeners = []\n\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (this.autoComplete && changes['options']) {\n this.autoComplete.setOptions(this._options)\n }\n }\n\n private _untilGoogleMapsApiLoaded(): Observable<void> {\n return interval(500).pipe(\n filter(() => !!(window.google && window.google.maps && window.google.maps.version)),\n take(1),\n mapTo(undefined),\n )\n }\n\n /**\n * Returns the bounds to which predictions are biased.\n */\n public getBounds(): google.maps.LatLngBounds | undefined {\n this._assertInitialized()\n return this.autoComplete.getBounds()\n }\n\n /**\n * Returns the fields to be included for the Place in the details response\n * when the details are successfully retrieved. For a list of fields see\n * [PlaceResult](https://developers.google.com/maps/documentation/javascript/reference/places-service#PlaceResult).\n */\n public getFields(): string[] | undefined {\n this._assertInitialized()\n return (this.autoComplete as any).getFields()\n }\n\n /**\n * Returns the details of the Place selected by user if the details were\n * successfully retrieved. Otherwise returns a stub Place object, with the\n * name property set to the current value of the input field.\n */\n public getPlace(): google.maps.places.PlaceResult {\n this._assertInitialized()\n return this.autoComplete.getPlace()\n }\n\n /**\n * Sets the preferred area within which to return Place results. Results are\n * biased towards, but not restricted to, this area.\n */\n public setBounds(bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral): void {\n this._assertInitialized()\n // tslint:disable-next-line: no-non-null-assertion\n return this.autoComplete.setBounds(bounds!)\n }\n\n /**\n * Sets the component restrictions. Component restrictions are used to\n * restrict predictions to only those within the parent component. For\n * example, the country.\n */\n public setComponentRestrictions(restrictions?: google.maps.places.ComponentRestrictions): void {\n this._assertInitialized()\n // tslint:disable-next-line: no-non-null-assertion\n return this.autoComplete.setComponentRestrictions(restrictions!)\n }\n\n /**\n * Sets the fields to be included for the Place in the details response when\n * the details are successfully retrieved. For a list of fields see\n * [PlaceResult](https://developers.google.com/maps/documentation/javascript/reference/places-service#PlaceResult).\n */\n public setFields(fields?: string[]): void {\n this._assertInitialized()\n // tslint:disable-next-line: no-non-null-assertion\n return this.autoComplete.setFields(fields!)\n }\n\n /** */\n public setOptions(options?: google.maps.places.AutocompleteOptions): void {\n this._assertInitialized()\n // tslint:disable-next-line: no-non-null-assertion\n return this.autoComplete.setOptions(options!)\n }\n\n /**\n * Sets the types of predictions to be returned. For supported types, see the\n * [developer's guide](https://developers.google.com/maps/documentation/javascript/places-autocomplete#constrain-place-types).\n * If no types are specified, all types will be returned.\n */\n public setTypes(types?: string[]): void {\n this._assertInitialized()\n // tslint:disable-next-line: no-non-null-assertion\n return this.autoComplete.setTypes(types!)\n }\n\n /** Focuses the input. */\n public focus(): void {\n this._elementRef.nativeElement.focus()\n }\n\n /** Unfocuses the input. */\n public blur(): void {\n this._elementRef.nativeElement.blur()\n }\n\n public getHostElement(): HTMLInputElement {\n return this._elementRef.nativeElement\n }\n\n private _createPlaceChangedObservable<T>(): Observable<T> {\n const observable = new Observable<T>(subscriber => {\n if (!this.autoComplete) {\n this._placeChangedPending.push({ observable, subscriber })\n return undefined\n }\n const listener = this.autoComplete.addListener('place_changed', (event: T) => {\n this._ngZone.run(() => subscriber.next(event))\n })\n this._listeners.push(listener)\n\n return () => listener.remove()\n })\n return observable\n }\n\n /** Asserts that the map has been initialized. */\n private _assertInitialized(): asserts this is WithRequired<TheSeamGoogleMapsPlacesAutocompleteDirective, 'autoComplete'> {\n if (!this.autoComplete && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error(\n 'Cannot access Google Map Places information before the API has been initialized. ' +\n 'Please wait for the API to load before trying to interact with it.',\n )\n }\n }\n}\n","import { BooleanInput, coerceNumberProperty } from '@angular/cdk/coercion'\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n HostListener,\n Input,\n OnDestroy,\n OnInit,\n Output,\n ViewChild,\n} from '@angular/core'\nimport { interval, Observable, of, Subject, Subscriber } from 'rxjs'\nimport { filter, mapTo, startWith, switchMap, take, takeUntil } from 'rxjs/operators'\n\nimport { faSearchLocation } from '@fortawesome/free-solid-svg-icons'\nimport { InputBoolean } from '@theseam/ui-common/core'\nimport { InputDirective } from '@theseam/ui-common/form-field'\nimport { SeamIcon } from '@theseam/ui-common/icon'\n\nimport { SEAM_GOOGLE_PLACES_AUTOCOMPLETE_DEFAULT_OPTIONS, TheSeamGoogleMapsPlacesAutocompleteDirective } from './google-maps-places-autocomplete.directive'\n\ndeclare const ngDevMode: boolean | undefined\ntype WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] }\n\n/**\n *\n */\n@Component({\n selector: 'seam-google-maps-places-autocomplete',\n templateUrl: './google-maps-places-autocomplete.component.html',\n styleUrls: ['./google-maps-places-autocomplete.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n exportAs: 'seamGoogleMapsPlacesAutoComplete'\n})\nexport class TheSeamGoogleMapsPlacesAutoCompleteComponent implements OnInit, OnDestroy {\n static ngAcceptInputType_disabled: BooleanInput\n\n private readonly _ngUnsubscribe = new Subject<void>()\n private readonly _autoCompleteReadySubject = new Subject()\n\n private _placeChangedPending: { observable: Observable<any>, subscriber: Subscriber<any> }[] = []\n\n public autoComplete?: google.maps.places.Autocomplete\n\n @Input() label: string | undefined | null = 'Search by address, place or name'\n\n @Input() icon: SeamIcon | undefined | null = faSearchLocation\n\n @Input() @InputBoolean() disabled: BooleanInput = false\n\n @Input() placeholder: string | undefined | null = 'Enter address, place or name'\n\n @Input() autocorrect: 'off' | 'on' | undefined | null = 'off'\n\n @Input() autocapitalize: 'off' | 'on' | undefined | null = 'off'\n\n /**\n * Set the tab index to `-1` to allow the root element of the\n * component to receive `focus` event from javascript, but not get focused by\n * keyboard navigation.\n */\n @Input()\n set tabIndex(value: number) { this._tabIndex = coerceNumberProperty(value) }\n get tabIndex(): number { return this._tabIndex }\n private _tabIndex = -1\n\n @Input()\n set options(value: google.maps.places.AutocompleteOptions | undefined | null) {\n this._options = value || SEAM_GOOGLE_PLACES_AUTOCOMPLETE_DEFAULT_OPTIONS\n }\n _options: google.maps.places.AutocompleteOptions = SEAM_GOOGLE_PLACES_AUTOCOMPLETE_DEFAULT_OPTIONS\n\n /**\n * This event is fired when a PlaceResult is made available for a Place the\n * user has selected. If the user enters the name of a Place that was not\n * suggested by the control and presses the Enter key, or if a Place Details\n * request fails, the PlaceResult contains the user input in the name\n * property, with no other properties defined.\n *\n * See: https://developers.google.com/maps/documentation/javascript/reference/places-widget#Autocomplete.place_changed\n */\n @Output() readonly placeChanged: Observable<void>\n\n @ViewChild('inp', { read: InputDirective, static: true }) _inputDirective!: InputDirective\n\n @ViewChild(TheSeamGoogleMapsPlacesAutocompleteDirective, { static: true })\n set __autocompleteDirective(value: TheSeamGoogleMapsPlacesAutocompleteDirective) {\n this._autoCompleteDirective = value\n this._untilAutoCompleteReady().pipe(takeUntil(this._ngUnsubscribe)).subscribe(() => {\n this.autoComplete = this._autoCompleteDirective.autoComplete\n this._placeChangedPending.forEach(pending => pending.observable.subscribe(pending.subscriber))\n this._placeChangedPending = []\n })\n }\n _autoCompleteDirective!: TheSeamGoogleMapsPlacesAutocompleteDirective\n\n @HostBinding('attr.tabindex')\n get _attrTabIndex() { return this.disabled ? -1 : (this.tabIndex || 0) }\n\n @HostListener('click', [ 'event' ])\n _onClick(event: MouseEvent) {\n this._inputDirective.focus()\n }\n\n @HostListener('focus', [ '$event' ])\n _onFocus() {\n this._inputDirective?.focus()\n }\n\n constructor(\n private readonly _elementRef: ElementRef,\n ) {\n this.placeChanged = this._autoCompleteReadySubject.pipe(\n startWith(undefined),\n switchMap(() => this._createPlaceChangedObservable<any>())\n )\n }\n\n ngOnInit() { }\n\n /** @ignore */\n ngOnDestroy() {\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n\n private _untilAutoCompleteReady(): Observable<void> {\n return interval(500).pipe(\n filter(() => !!this._autoCompleteDirective.autoComplete),\n take(1),\n mapTo(undefined),\n )\n }\n\n /**\n * Returns the bounds to which predictions are biased.\n */\n public getBounds(): google.maps.LatLngBounds | undefined {\n this._assertInitialized()\n return this.autoComplete.getBounds()\n }\n\n /**\n * Returns the fields to be included for the Place in the details response\n * when the details are successfully retrieved. For a list of fields see\n * [PlaceResult](https://developers.google.com/maps/documentation/javascript/reference/places-service#PlaceResult).\n */\n public getFields(): string[] | undefined {\n this._assertInitialized()\n return (this.autoComplete as any).getFields()\n }\n\n /**\n * Returns the details of the Place selected by user if the details were\n * successfully retrieved. Otherwise returns a stub Place object, with the\n * name property set to the current value of the input field.\n */\n public getPlace(): google.maps.places.PlaceResult {\n this._assertInitialized()\n return this.autoComplete.getPlace()\n }\n\n /**\n * Sets the preferred area within which to return Place results. Results are\n * biased towards, but not restricted to, this area.\n */\n public setBounds(bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral): void {\n this._assertInitialized()\n // tslint:disable-next-line: no-non-null-assertion\n return this.autoComplete.setBounds(bounds!)\n }\n\n /**\n * Sets the component restrictions. Component restrictions are used to\n * restrict predictions to only those within the parent component. For\n * example, the country.\n */\n public setComponentRestrictions(restrictions?: google.maps.places.ComponentRestrictions): void {\n this._assertInitialized()\n // tslint:disable-next-line: no-non-null-assertion\n return this.autoComplete.setComponentRestrictions(restrictions!)\n }\n\n /**\n * Sets the fields to be included for the Place in the details response when\n * the details are successfully retrieved. For a list of fields see\n * [PlaceResult](https://developers.google.com/maps/documentation/javascript/reference/places-service#PlaceResult).\n */\n public setFields(fields?: string[]): void {\n this._assertInitialized()\n // tslint:disable-next-line: no-non-null-assertion\n return this.autoComplete.setFields(fields!)\n }\n\n /** */\n public setOptions(options?: google.maps.places.AutocompleteOptions): void {\n this._assertInitialized()\n // tslint:disable-next-line: no-non-null-assertion\n return this.autoComplete.setOptions(options!)\n }\n\n /**\n * Sets the types of predictions to be returned. For supported types, see the\n * [developer's guide](https://developers.google.com/maps/documentation/javascript/places-autocomplete#constrain-place-types).\n * If no types are specified, all types will be returned.\n */\n public setTypes(types?: string[]): void {\n this._assertInitialized()\n // tslint:disable-next-line: no-non-null-assertion\n return this.autoComplete.setTypes(types!)\n }\n\n /** Focuses the input. */\n public focus(): void {\n this._elementRef.nativeElement.focus()\n }\n\n /** Unfocuses the input. */\n public blur(): void {\n this._elementRef.nativeElement.blur()\n }\n\n public getHostElement(): HTMLInputElement {\n return this._elementRef.nativeElement\n }\n\n private _createPlaceChangedObservable<T>(): Observable<T> {\n const observable = new Observable<T>(subscriber => {\n if (!this.autoComplete) {\n this._placeChangedPending.push({ observable, subscriber })\n return undefined\n }\n\n const sub = this._autoCompleteDirective.placeChanged.subscribe(subscriber)\n\n return () => sub.unsubscribe()\n })\n return observable\n }\n\n /** Asserts that the map has been initialized. */\n private _assertInitialized(): asserts this is WithRequired<TheSeamGoogleMapsPlacesAutoCompleteComponent, 'autoComplete'> {\n if (!this.autoComplete && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error(\n 'Cannot access Google Map Places information before the API has been initialized. ' +\n 'Please wait for the API to load before trying to interact with it.',\n )\n }\n }\n\n}\n","import { OnInit } from '@angular/core'\nimport {\n ChangeDetectionStrategy,\n Component,\n Inject,\n Input,\n OnDestroy,\n} from '@angular/core'\nimport { Subject } from 'rxjs'\nimport { takeUntil, tap } from 'rxjs/operators'\n\nimport { GoogleMapsControlsService, MapControlRef } from './google-maps-controls.service'\nimport { GoogleMapsService } from './google-maps.service'\nimport { MapControl, MAP_CONTROLS_SERVICE } from './map-controls-service'\n\n@Component({\n selector: 'seam-map-control',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TheSeamMapsControlComponent implements OnInit, OnDestroy {\n private readonly _ngUnsubscribe = new Subject<void>()\n\n private _controlRef?: MapControlRef\n\n @Input()\n set def(value: MapControl | null | undefined) {\n if (value !== this._def) {\n this._remove()\n this._def = value\n }\n }\n _def: MapControl | null | undefined\n\n constructor(\n private readonly _googleMaps: GoogleMapsService,\n @Inject(MAP_CONTROLS_SERVICE) private readonly _googleMapsControls: GoogleMapsControlsService,\n ) { }\n\n /** @ignore */\n ngOnInit(): void {\n this._googleMaps.mapReady$.pipe(\n tap(ready => {\n if (ready) {\n this._add()\n } else {\n this._remove()\n }\n }),\n takeUntil(this._ngUnsubscribe)\n ).subscribe()\n }\n\n /** @ignore */\n ngOnDestroy(): void {\n this._remove()\n\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n\n private _add(): void {\n if (this._controlRef) {\n return\n }\n\n if (this._def === null || this._def === undefined) {\n return\n }\n\n this._controlRef = this._googleMapsControls.add(this._def)\n }\n\n private _remove(): void {\n this._controlRef?.destroy()\n this._controlRef = undefined\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n NgZone,\n OnDestroy,\n OnInit,\n Renderer2,\n} from '@angular/core'\nimport { Subject } from 'rxjs'\nimport { takeUntil, tap } from 'rxjs/operators'\n\nimport { readGeoFile } from '@theseam/ui-common/utils'\n\nimport { GoogleMapsService } from '../google-maps.service'\nimport { MapValueManagerService, MapValueSource } from '../map-value-manager.service'\n\n/**\n *\n */\n@Component({\n selector: 'seam-map-file-drop',\n templateUrl: './map-file-drop.component.html',\n styleUrls: ['./map-file-drop.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TheSeamMapFileDropComponent implements OnInit, OnDestroy {\n\n private readonly _ngUnsubscribe = new Subject<void>()\n\n /**\n * Map element drag events added to.\n */\n private _mapDiv: HTMLDivElement | undefined\n\n private _listeners: (() => void)[] = []\n\n private _globalDragInProgress: boolean = false\n\n constructor(\n private readonly _elementRef: ElementRef,\n private readonly _ngZone: NgZone,\n private readonly _googleMaps: GoogleMapsService,\n private readonly _mapValueManager: MapValueManagerService,\n private readonly _renderer: Renderer2\n ) { }\n\n /** @ignore */\n ngOnInit() {\n this._googleMaps.mapReady$.pipe(\n tap(ready => {\n if (ready) {\n this._enableFileDrop()\n } else {\n this._disableFileDrop()\n }\n }),\n takeUntil(this._ngUnsubscribe)\n ).subscribe()\n }\n\n /** @ignore */\n ngOnDestroy() {\n this._disableFileDrop()\n\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n\n private _enableFileDrop(): void {\n const divElement = this._googleMaps.getDiv()\n if (this._mapDiv === divElement) {\n return\n }\n\n if (this._mapDiv !== undefined) {\n // Disable file drop on previous map div.\n this._disableFileDrop()\n }\n\n this._mapDiv = divElement\n this._ngZone.runOutsideAngular(() => {\n this._listeners.push(this._renderer.listen('document', 'dragstart', (event: Event) => {\n this._globalDragInProgress = true\n }))\n\n this._listeners.push(this._renderer.listen('document', 'dragend', (event: Event) => {\n this._globalDragInProgress = false\n }))\n\n this._listeners.push(this._renderer.listen(divElement, 'dragover', this._handleDragOverEvent))\n this._listeners.push(this._renderer.listen(this._elementRef.nativeElement, 'dragover', this._handleDragOverEvent))\n this._listeners.push(this._renderer.listen(this._elementRef.nativeElement, 'drop', this._handleDropEvent))\n this._listeners.push(this._renderer.listen(divElement, 'dragenter', this._handleDragEnterEvent))\n this._listeners.push(this._renderer.listen(this._elementRef.nativeElement, 'dragleave', this._handleDragLeaveEvent))\n })\n }\n\n private _disableFileDrop(): void {\n if (this._listeners.length > 0) {\n this._listeners.forEach(l => l())\n this._listeners = []\n }\n }\n\n private readonly _handleDragOverEvent = (event: any) => {\n if (!this._dropAllowed()) {\n return\n }\n\n if (!this._isSupportedDataTransferTypes(event.dataTransfer)) {\n return\n }\n\n event.preventDefault()\n event.dataTransfer.dropEffect = 'copy'\n }\n\n private readonly _handleDropEvent = (event: any) => {\n if (!this._dropAllowed()) {\n return\n }\n\n event.preventDefault()\n event.stopPropagation()\n this._renderer.setStyle(this._elementRef.nativeElement, 'display', 'none')\n\n // TODO: Show error if multiple files?\n if (!this._isSupportedDataTransfer(event.dataTransfer)) {\n return\n }\n\n const item = event.dataTransfer.items[0]\n const file = item.getAsFile()\n readGeoFile(file).then(json => {\n this._mapValueManager.setValue(json, MapValueSource.Input)\n })\n }\n\n private readonly _handleDragEnterEvent = (event: any) => {\n if (!this._dropAllowed()) {\n return\n }\n\n if (!this._isSupportedDataTransferTypes(event.dataTransfer)) {\n return\n }\n\n this._renderer.setStyle(this._elementRef.nativeElement, 'display', 'block')\n }\n\n private readonly _handleDragLeaveEvent = (event: any) => {\n if (!this._dropAllowed()) {\n return\n }\n\n this._renderer.setStyle(this._elementRef.nativeElement, 'display', 'none')\n }\n\n private _dropAllowed(): boolean {\n return !this._globalDragInProgress\n }\n\n private _isSupportedDataTransfer(dataTransfer: DataTransfer): boolean {\n return dataTransfer.files.length === 1 && dataTransfer.types[0] === 'Files'\n }\n\n private _isSupportedDataTransferTypes(dataTransfer: DataTransfer): boolean {\n return dataTransfer.types[0] === 'Files'\n }\n\n}\n","import { ObserversModule } from '@angular/cdk/observers'\nimport { CommonModule } from '@angular/common'\nimport { NgModule } from '@angular/core'\n\nimport { AgmCoreModule } from '@agm/core'\nimport { TheSeamFormFieldModule } from '@theseam/ui-common/form-field'\nimport { TheSeamIconModule } from '@theseam/ui-common/icon'\nimport { TheSeamMenuModule } from '@theseam/ui-common/menu'\nimport { TheSeamSharedModule } from '@theseam/ui-common/shared'\n\nimport { TheSeamGoogleMapsPlacesAutoCompleteComponent } from './google-maps-places-autocomplete/google-maps-places-autocomplete.component'\nimport { TheSeamGoogleMapsPlacesAutocompleteDirective } from './google-maps-places-autocomplete/google-maps-places-autocomplete.directive'\nimport { TheSeamGoogleMapsRecenterButtonControlComponent } from './google-maps-recenter-button-control/google-maps-recenter-button-control.component'\nimport { TheSeamGoogleMapsUploadButtonControlComponent } from './google-maps-upload-button-control/google-maps-upload-button-control.component'\nimport { TheSeamGoogleMapsComponent } from './google-maps/google-maps.component'\nimport { TheSeamMapsControlComponent } from './map-control.component'\nimport { TheSeamMapFileDropComponent } from './map-file-drop/map-file-drop.component'\n\n@NgModule({\n declarations: [\n TheSeamGoogleMapsComponent,\n TheSeamMapFileDropComponent,\n TheSeamGoogleMapsUploadButtonControlComponent,\n TheSeamGoogleMapsRecenterButtonControlComponent,\n TheSeamMapsControlComponent,\n TheSeamGoogleMapsPlacesAutocompleteDirective,\n TheSeamGoogleMapsPlacesAutoCompleteComponent,\n ],\n imports: [\n CommonModule,\n ObserversModule,\n TheSeamSharedModule,\n TheSeamMenuModule,\n TheSeamIconModule,\n TheSeamFormFieldModule,\n AgmCoreModule,\n ],\n exports: [\n TheSeamGoogleMapsComponent,\n TheSeamGoogleMapsPlacesAutocompleteDirective,\n TheSeamGoogleMapsPlacesAutoCompleteComponent\n ]\n})\nexport class TheSeamGoogleMapsModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {MAP_CONTROLS_SERVICE as ɵb,MAP_CONTROL_DATA as ɵc,MapControl as ɵa} from './map-controls-service';"],"names":["polygon","turfjsPolygon","multiPolygon","turfjsMultiPolygon"],"mappings":";;;;;;;;;;;;;;;;;;;;;IAWY;AAAZ,WAAY,sBAAsB;IAChC,0DAAgC,CAAA;AAClC,CAAC,EAFW,sBAAsB,KAAtB,sBAAsB,QAEjC;SAEe,oBAAoB,CAAC,YAAoB;IACvD,OAAO,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC;SACzC,SAAS,CAAC,KAAK,IAAI,KAAK,KAAK,YAAY,CAAC,KAAK,CAAC,CAAC,CAAA;AACtD,CAAC;SAEe,iBAAiB,CAAC,OAAiC;IACjE,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAAA;IACzE,OAAO,qBAAqB,CAAC,UAAU,CAAC,CAAA;AAC1C,CAAC;SAEe,kBAAkB,CAAC,OAAiC,EAAE,UAAmB;IACvF,OAAO,CAAC,WAAW,CAAC,sBAAsB,CAAC,UAA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