github
1710 of 2234 branches covered (76.54%)
Branch coverage included in aggregate %.
94 of 141 new or added lines in 25 files covered. (66.67%)
20319 existing lines in 272 files now uncovered.35902 of 63049 relevant lines covered (56.94%)
11.42 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 |
} |
× |