Skip to content

Commit ca91bbc

Browse files
authored
Bug fixes in google overlay (visgl#6083)
1 parent f75a16e commit ca91bbc

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

modules/google-maps/src/google-maps-overlay.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const HIDE_ALL_LAYERS = () => false;
1212
const GL_STATE = {
1313
depthMask: true,
1414
depthTest: true,
15+
blend: true,
1516
blendFunc: [GL.SRC_ALPHA, GL.ONE_MINUS_SRC_ALPHA, GL.ONE, GL.ONE_MINUS_SRC_ALPHA],
1617
blendEquation: GL.FUNC_ADD
1718
};
@@ -35,9 +36,15 @@ export default class GoogleMapsOverlay {
3536
}
3637
if (map) {
3738
this._map = map;
38-
map.addListener('renderingtype_changed', () => {
39+
const {UNINITIALIZED} = google.maps.RenderingType;
40+
const renderingType = map.getRenderingType();
41+
if (renderingType !== UNINITIALIZED) {
3942
this._createOverlay(map);
40-
});
43+
} else {
44+
map.addListener('renderingtype_changed', () => {
45+
this._createOverlay(map);
46+
});
47+
}
4148
}
4249
}
4350

@@ -79,7 +86,7 @@ export default class GoogleMapsOverlay {
7986
if (renderingType === UNINITIALIZED) {
8087
return;
8188
}
82-
const isVectorMap = renderingType === VECTOR;
89+
const isVectorMap = renderingType === VECTOR && google.maps.WebglOverlayView;
8390
const OverlayView = isVectorMap ? google.maps.WebglOverlayView : google.maps.OverlayView;
8491
const overlay = new OverlayView();
8592

0 commit comments

Comments
 (0)