incyclist-services 1.8.2 → 1.8.4

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.
@@ -103,11 +103,12 @@ let GpxDisplayService = (() => {
103
103
  }
104
104
  }
105
105
  getStreetViewProps(rideProps) {
106
+ const sideViewsSupported = this.isSideViewsSupported();
106
107
  const sideViews = {
107
- enabled: true,
108
+ enabled: sideViewsSupported,
108
109
  hide: rideProps.hideAll,
109
- left: this.getUserSettings().get('preferences.sideViews.sv-left', true),
110
- right: this.getUserSettings().get('preferences.sideViews.sv-right', true),
110
+ left: sideViewsSupported && this.getUserSettings().get('preferences.sideViews.sv-left', false),
111
+ right: sideViewsSupported && this.getUserSettings().get('preferences.sideViews.sv-right', false),
111
112
  };
112
113
  const props = {
113
114
  onDisplayEvent: this.onStreetViewEvent.bind(this),
@@ -120,6 +121,10 @@ let GpxDisplayService = (() => {
120
121
  }
121
122
  return props;
122
123
  }
124
+ isSideViewsSupported() {
125
+ return this.getGoogleMaps().hasPersonalApiKey()
126
+ || this.getGoogleMaps().hasDevelopmentApiKey();
127
+ }
123
128
  getInitialStreetViewPosition() {
124
129
  return this.enrichWithHeading(this.position, 'getInitialStreetViewPosition');
125
130
  }
@@ -100,11 +100,12 @@ let GpxDisplayService = (() => {
100
100
  }
101
101
  }
102
102
  getStreetViewProps(rideProps) {
103
+ const sideViewsSupported = this.isSideViewsSupported();
103
104
  const sideViews = {
104
- enabled: true,
105
+ enabled: sideViewsSupported,
105
106
  hide: rideProps.hideAll,
106
- left: this.getUserSettings().get('preferences.sideViews.sv-left', true),
107
- right: this.getUserSettings().get('preferences.sideViews.sv-right', true),
107
+ left: sideViewsSupported && this.getUserSettings().get('preferences.sideViews.sv-left', false),
108
+ right: sideViewsSupported && this.getUserSettings().get('preferences.sideViews.sv-right', false),
108
109
  };
109
110
  const props = {
110
111
  onDisplayEvent: this.onStreetViewEvent.bind(this),
@@ -117,6 +118,10 @@ let GpxDisplayService = (() => {
117
118
  }
118
119
  return props;
119
120
  }
121
+ isSideViewsSupported() {
122
+ return this.getGoogleMaps().hasPersonalApiKey()
123
+ || this.getGoogleMaps().hasDevelopmentApiKey();
124
+ }
120
125
  getInitialStreetViewPosition() {
121
126
  return this.enrichWithHeading(this.position, 'getInitialStreetViewPosition');
122
127
  }
@@ -28,6 +28,7 @@ export declare class GpxDisplayService extends RouteDisplayService {
28
28
  constructor();
29
29
  protected initView(): void;
30
30
  getStreetViewProps(rideProps: CurrentRideDisplayProps): any;
31
+ isSideViewsSupported(): boolean;
31
32
  protected getInitialStreetViewPosition(): CurrentPosition;
32
33
  protected getSatelliteViewPosition(): CurrentPosition;
33
34
  protected enrichWithHeading(position: CurrentPosition | undefined, logContext: string): CurrentPosition;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incyclist-services",
3
- "version": "1.8.2",
3
+ "version": "1.8.4",
4
4
  "peerDependencies": {
5
5
  "gd-eventlog": "^0.1.27"
6
6
  },