import { WPGPXMAPS } from '../Utils/Utils'; import { MapboxStyleDefinition, MapboxStyleSwitcherOptions, MapboxStyleSwitcherControl } from "mapbox-gl-style-switcher"; import mapboxgl, { ControlPosition, GeoJSONSource, IControl, LngLatBounds, Map, Marker } from 'mapbox-gl'; import * as turf from '@turf/turf'; import 'mapbox-gl/dist/mapbox-gl.css'; import "mapbox-gl-style-switcher/styles.css"; class AnumationControl implements IControl { container: HTMLElement; start: number = 0.0; animationDuration: number = 80000; cameraAltitude: number = 1000; targetRoute: Array = []; cameraRoute: Array = []; map: Map; iconDefault: string = '/wp-content/plugins/wp-gpx-maps/img/map-play-svgrepo-com.svg'; iconStop: string = '/wp-content/plugins/wp-gpx-maps/img/stop-svgrepo-com.svg'; routeDistance: number = 0.0; cameraRouteDistance: number = 0.0; isPlaying: boolean = false; onAdd(map: Map): HTMLElement { this.map = map; this.container = document.createElement('div'); this.container.className = 'mapboxgl-ctrl mapboxgl-ctrl-group mapboxgl-wp-gpx-maps'; this.container.innerHTML = `