github
1903 of 2546 branches covered (74.74%)
Branch coverage included in aggregate %.
775 of 823 new or added lines in 10 files covered. (94.17%)
17884 existing lines in 262 files now uncovered.37927 of 62547 relevant lines covered (60.64%)
158.97 hits per line
1 |
/* global window */
|
|
2 |
/* eslint-disable import/namespace */
|
1✔ |
3 |
import {log} from '@deck.gl/core'; |
1✔ |
4 |
import {GoogleMapsOverlay} from '@deck.gl/google-maps'; |
1✔ |
5 |
|
1✔ |
6 |
export function createGoogleMapsDeckOverlay({ |
1✔ |
UNCOV
7
|
container, |
× |
UNCOV
8
|
onClick, |
× |
UNCOV
9
|
onComplete, |
× |
UNCOV
10
|
getTooltip, |
× |
UNCOV
11
|
googleMapsKey, |
× |
UNCOV
12
|
layers, |
× |
UNCOV
13
|
mapStyle = 'satellite',
|
× |
UNCOV
14
|
initialViewState = {latitude: 0, longitude: 0, zoom: 1} |
× |
UNCOV
15
|
}) { |
× |
UNCOV
16
|
if (!googleMapsKey) {
|
× |
UNCOV
17
|
log.warn('No Google Maps API key set')();
|
× |
UNCOV
18
|
return null; |
× |
UNCOV
19
|
} |
× |
UNCOV
20
|
const deckOverlay = new GoogleMapsOverlay({layers});
|
× |
21 |
const view = { |
× |
22 |
center: {lat: initialViewState.latitude, lng: initialViewState.longitude}, |
× |
23 |
mapTypeId: mapStyle,
|
× |
24 |
zoom: initialViewState.zoom
|
× |
25 |
}; |
× |
26 |
|
× |
27 |
const map = new window.google.maps.Map(container, view);
|
× |
28 |
deckOverlay.setMap(map); |
× |
29 |
return deckOverlay;
|
× |
30 |
} |
× |