Skip to content

Commit

Permalink
Support map rotation #669 - Make recording work.
Browse files Browse the repository at this point in the history
  • Loading branch information
HarelM committed Dec 2, 2018
1 parent 5358dfa commit dd9e19a
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { RouteLayerFactory } from "../services/layers/routelayers/route-layer.fa
import { CancelableTimeoutService } from "../services/cancelable-timeout.service";
import { DragInteraction } from "./intercations/drag.interaction";
import { SelectedRouteService } from "../services/layers/routelayers/selected-route.service";
import { AddRouteAction, StopRecordingAction } from "../reducres/routes.reducer";
import { AddRouteAction, StopRecordingAction, AddRecordingPointAction } from "../reducres/routes.reducer";
import { SetSelectedRouteAction } from "../reducres/route-editing-state.reducer";
import { SpatialService } from "../services/spatial.service";
import { RouteData, ApplicationState, LatLngAlt, DataContainer, TraceVisibility } from "../models/models";
Expand Down Expand Up @@ -92,14 +92,18 @@ export class LocationComponent extends BaseMapComponent {
});

this.geoLocationService.positionChanged.subscribe(
(position) => {
(position: Position) => {
if (position == null) {
this.toastService.warning(this.resources.unableToFindYourLocation);
} else {
this.updateMarkerPosition(position);
let recordingRoute = this.selectedRouteService.getRouteById(this.recordingRouteId);
if (recordingRoute != null && recordingRoute.isRecording) {
this.lastRecordedRoute = recordingRoute;
this.ngRedux.dispatch(new AddRecordingPointAction({
routeId: recordingRoute.id,
latlng: this.geoLocationService.currentLocation
}));
this.lastRecordedRoute = this.selectedRouteService.getRouteById(this.recordingRouteId);
}
}
});
Expand Down Expand Up @@ -234,6 +238,7 @@ export class LocationComponent extends BaseMapComponent {
}
this.locationCoordinate.lng = position.coords.longitude;
this.locationCoordinate.lat = position.coords.latitude;
this.locationCoordinate.alt = position.coords.altitude;
this.locationCoordinate.radius = position.coords.accuracy;
if (this.isFollowing) {
this.setLocation();
Expand Down

0 comments on commit dd9e19a

Please sign in to comment.