added google map view with markers of the avialable images;
This commit is contained in:
parent
f0174aadc7
commit
54083540d1
21
frontend/package-lock.json
generated
21
frontend/package-lock.json
generated
@ -10,6 +10,21 @@
|
|||||||
"integrity": "sha512-5Hmejfgemk1qJw24M5I+NabADKmD5Io7LU2fxHw/E6Bo0ji9EdmHP16KrFnt6Sz0/w7VIzc1ZAasyLULaPLGJQ==",
|
"integrity": "sha512-5Hmejfgemk1qJw24M5I+NabADKmD5Io7LU2fxHw/E6Bo0ji9EdmHP16KrFnt6Sz0/w7VIzc1ZAasyLULaPLGJQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"@agm/core": {
|
||||||
|
"version": "3.0.0-beta.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@agm/core/-/core-3.0.0-beta.0.tgz",
|
||||||
|
"integrity": "sha512-KNmKbe89Nen7s7+mX63RgX88jBfajUZCFqkHIQ8Fd+Lf/ko/IY6yw4kPh0iYGxgPVPjpsHJ06GZ5m3ZxpEVX9A==",
|
||||||
|
"requires": {
|
||||||
|
"tslib": "^2.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz",
|
||||||
|
"integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"@angular-devkit/architect": {
|
"@angular-devkit/architect": {
|
||||||
"version": "0.901.12",
|
"version": "0.901.12",
|
||||||
"resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.901.12.tgz",
|
"resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.901.12.tgz",
|
||||||
@ -2935,6 +2950,12 @@
|
|||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@types/googlemaps": {
|
||||||
|
"version": "3.39.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/googlemaps/-/googlemaps-3.39.12.tgz",
|
||||||
|
"integrity": "sha512-z1RMvlQfmsLbg5kc0dGjSHK7DL64mOCbbtqp/Le2M3ov7xPB1d+stia38hqmOXw5dPO1dL/5fscn73d0uomkbw==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"@types/jasmine": {
|
"@types/jasmine": {
|
||||||
"version": "3.4.6",
|
"version": "3.4.6",
|
||||||
"resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-3.4.6.tgz",
|
"resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-3.4.6.tgz",
|
||||||
|
|||||||
@ -12,6 +12,7 @@
|
|||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@agm/core": "^3.0.0-beta.0",
|
||||||
"@angular-devkit/schematics": "~9.1.7",
|
"@angular-devkit/schematics": "~9.1.7",
|
||||||
"@angular/animations": "~9.1.9",
|
"@angular/animations": "~9.1.9",
|
||||||
"@angular/cdk": "9.2.4",
|
"@angular/cdk": "9.2.4",
|
||||||
@ -39,6 +40,7 @@
|
|||||||
"@angular/compiler-cli": "~9.1.9",
|
"@angular/compiler-cli": "~9.1.9",
|
||||||
"@angular/language-service": "~9.1.9",
|
"@angular/language-service": "~9.1.9",
|
||||||
"@compodoc/compodoc": "~1.1.11",
|
"@compodoc/compodoc": "~1.1.11",
|
||||||
|
"@types/googlemaps": "3.39.12",
|
||||||
"@types/jasmine": "~3.4.6",
|
"@types/jasmine": "~3.4.6",
|
||||||
"@types/jasminewd2": "~2.0.8",
|
"@types/jasminewd2": "~2.0.8",
|
||||||
"@types/node": "^12.12.42",
|
"@types/node": "^12.12.42",
|
||||||
|
|||||||
@ -20,6 +20,7 @@ import {MatTableModule} from '@angular/material/table';
|
|||||||
import {MatTabsModule} from '@angular/material/tabs';
|
import {MatTabsModule} from '@angular/material/tabs';
|
||||||
import { ImagesComponent } from './component/images/images.component';
|
import { ImagesComponent } from './component/images/images.component';
|
||||||
import { MapComponent } from './component/map/map.component';
|
import { MapComponent } from './component/map/map.component';
|
||||||
|
import {AgmCoreModule} from '@agm/core';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [LandingComponent, ImagesComponent, MapComponent],
|
declarations: [LandingComponent, ImagesComponent, MapComponent],
|
||||||
@ -40,6 +41,14 @@ import { MapComponent } from './component/map/map.component';
|
|||||||
MatPaginatorModule,
|
MatPaginatorModule,
|
||||||
MatTableModule,
|
MatTableModule,
|
||||||
MatTabsModule,
|
MatTabsModule,
|
||||||
|
// GoogleMapsModule,
|
||||||
|
AgmCoreModule.forRoot({
|
||||||
|
apiKey: 'AIzaSyBDgLJ1sL48IQg7e5jrwmUyXkqeEfVnf78'
|
||||||
|
/* apiKey is required, unless you are a
|
||||||
|
premium customer, in which case you can
|
||||||
|
use clientId
|
||||||
|
*/
|
||||||
|
})
|
||||||
|
|
||||||
],
|
],
|
||||||
// enables injecting
|
// enables injecting
|
||||||
|
|||||||
@ -0,0 +1 @@
|
|||||||
|
agm-map { height: 50vh; /* height is required */ }
|
||||||
@ -1 +1,19 @@
|
|||||||
<h2>Image Locations</h2>
|
<h2>Map</h2>
|
||||||
|
|
||||||
|
<agm-map *ngIf="images"
|
||||||
|
[latitude]="latitude"
|
||||||
|
[longitude]="longitude"
|
||||||
|
[zoom]="2">
|
||||||
|
<agm-marker
|
||||||
|
*ngFor="let image of images"
|
||||||
|
[latitude]="image.latitude"
|
||||||
|
[longitude]="image.longitude"
|
||||||
|
[opacity]="1"
|
||||||
|
[markerDraggable]="true"
|
||||||
|
(markerClick)="selectMarker($event)"
|
||||||
|
></agm-marker>
|
||||||
|
</agm-map>
|
||||||
|
|
||||||
|
<p *ngIf="selectedImage">
|
||||||
|
Latitude: {{ selectedImage.latitude }} Longitude: {{ selectedImage.longitude }} Name: {{selectedImage.name}}
|
||||||
|
</p>
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import {Component, Input, OnInit} from '@angular/core';
|
import {Component, Input, OnInit} from '@angular/core';
|
||||||
import {ImageMetadata} from '../../interfaces/interface';
|
import {ImageMetadata} from '../../interfaces/interface';
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-map',
|
selector: 'app-map',
|
||||||
templateUrl: './map.component.html',
|
templateUrl: './map.component.html',
|
||||||
@ -11,10 +12,19 @@ export class MapComponent implements OnInit {
|
|||||||
@Input()
|
@Input()
|
||||||
images: ImageMetadata[];
|
images: ImageMetadata[];
|
||||||
|
|
||||||
|
selectedImage: ImageMetadata;
|
||||||
|
latitude = 43.879078;
|
||||||
|
longitude = -103.4615581;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit(): void {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
selectMarker(event) {
|
||||||
|
this.selectedImage = this.images.find(image => image.latitude === event.latitude && image.longitude === event.longitude);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"target": "es5",
|
"target": "es2015",
|
||||||
"typeRoots": [
|
"typeRoots": [
|
||||||
"node_modules/@types"
|
"node_modules/@types"
|
||||||
],
|
],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user