import {Component, Input, OnInit} from '@angular/core';
import {ImageMetadata} from '../../interfaces/interface';

// @ts-ignore
@Component({
  selector: 'app-map',
  templateUrl: './map.component.html',
  styleUrls: ['./map.component.css']
})
export class MapComponent implements OnInit {

  @Input()
  images: ImageMetadata[];

  selectedImage: ImageMetadata;
  latitude = 43.879078;
  longitude = -103.4615581;

  constructor() {

  }

  ngOnInit() {

  }

  selectMarker(event) {
    this.selectedImage = this.images.find(image => image.latitude === event.latitude && image.longitude === event.longitude);
  }
}
