Coveralls logob
Coveralls logo
  • Home
  • Features
  • Pricing
  • Docs
  • Sign In

uber / deck.gl / 13758

17 Sep 2019 - 21:06 coverage increased (+2.9%) to 82.762%
13758

Pull #3621

travis-ci-com

9181eb84f9c35729a3bad740fb7f9d93?size=18&default=identiconweb-flow
fix CI
Pull Request #3621: Support spring transition in UniformTransitionManager

3406 of 4621 branches covered (73.71%)

Branch coverage included in aggregate %.

59 of 63 new or added lines in 6 files covered. (93.65%)

499 existing lines in 85 files now uncovered.

7200 of 8194 relevant lines covered (87.87%)

4274.03 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

77.19
/modules/google-maps/src/google-maps-overlay.js
1
/* global google */
2
import {createDeckInstance, destroyDeckInstance, getViewState} from './utils';
3

4
const HIDE_ALL_LAYERS = () => false;
4×
5

6
export default class GoogleMapsOverlay {
7
  constructor(props) {
8
    this.props = {};
1×
9

10
    this._map = null;
2×
11

12
    const overlay = new google.maps.OverlayView();
2×
13
    overlay.onAdd = this._onAdd.bind(this);
2×
14
    overlay.onRemove = this._onRemove.bind(this);
1×
UNCOV
15
    overlay.draw = this._draw.bind(this);
!
16
    this._overlay = overlay;
2×
17

18
    this.setProps(props);
2×
19
  }
20

21
  /* Public API */
22

23
  setMap(map) {
24
    if (map === this._map) {
2×
25
      return;
2×
26
    }
27
    if (this._map) {
2×
28
      this._overlay.setMap(null);
2×
29
      this._map = null;
2×
30
    }
31
    if (map) {
2×
32
      this._map = map;
6×
33
      this._overlay.setMap(map);
2×
34
    }
35
  }
36

37
  setProps(props) {
38
    Object.assign(this.props, props);
4×
39
    if (this._deck) {
Branches [[3, 0]] missed. 2×
40
      this._deck.setProps(this.props);
2×
41
    }
42
  }
43

44
  pickObject(params) {
45
    return this._deck && this._deck.pickObject(params);
Branches [[4, 0], [4, 1]] missed. 4×
46
  }
47

48
  pickMultipleObjects(params) {
49
    return this._deck && this._deck.pickMultipleObjects(params);
Branches [[5, 0], [5, 1]] missed. 2×
50
  }
51

52
  pickObjects(params) {
53
    return this._deck && this._deck.pickObjects(params);
Branches [[6, 0], [6, 1]] missed. 2×
54
  }
55

56
  finalize() {
57
    this.setMap(null);
2×
58
    if (this._deck) {
Branches [[7, 1]] missed. 2×
UNCOV
59
      destroyDeckInstance(this._deck);
!
UNCOV
60
      this._deck = null;
!
61
    }
62
  }
63

64
  /* Private API */
65
  _onAdd() {
UNCOV
66
    this._deck = createDeckInstance(this._map, this._overlay, this._deck);
!
UNCOV
67
    this._deck.setProps(this.props);
!
68
  }
69

70
  _onRemove() {
71
    // Clear deck canvas
72
    this._deck.setProps({layerFilter: HIDE_ALL_LAYERS});
2×
73
  }
74

75
  _draw() {
76
    const deck = this._deck;
2×
77
    const {width, height, left, top, zoom, pitch, latitude, longitude} = getViewState(
2×
78
      this._map,
79
      this._overlay
80
    );
81

82
    const canSyncWithGoogleMaps = zoom >= 0 && pitch === 0;
2×
83

84
    deck.canvas.style.left = `${left}px`;
2×
85
    deck.canvas.style.top = `${top}px`;
2×
86

87
    deck.setProps({
2×
88
      width,
89
      height,
90
      viewState: {latitude, longitude, zoom},
91
      // deck.gl cannot sync with the base map with zoom < 0 and/or tilt
92
      layerFilter: canSyncWithGoogleMaps ? this.props.layerFilter : HIDE_ALL_LAYERS
93
    });
94
    // Deck is initialized
95
    deck.redraw();
2×
96
  }
97
}
Troubleshooting · Open an Issue · Sales · Support · ENTERPRISE · CAREERS · STATUS
BLOG · TWITTER · Legal & Privacy · Supported CI Services · What's a CI service? · Automated Testing

© 2019 Coveralls, LLC