Scatterplot layer clipped on top of Google Maps base layer
In attempting to identify the root cause of the offset in #576 (google maps + angular2), I tried to create an example of Deck.gl on top of a google maps baselayer provided by the react-google-maps package using a simple GoogleMaps base layer and OverlayLayer.
Findings:
- The offset issue in the angular example fork seems to be caused by some details of the implementation there, not an inherent issue with Google maps. I was able to sync the scatterplot manhattan data example perfectly, across multiple zooms levels.
- zoom is indeed off by 1, to match the zoom levels between Google Maps and Deck.gl, subtract 1 from the Google Maps zoom level when providing zoom to deck.gl. For example, Gmaps zoom_level=13 == Deck.gl zoom_level=12.
Here is an example repo that shows this integration on top of the scatterplot example.
The scatterplot layer snaps very well to the google maps baselayer, and stays attached even after zooming and panning. However, I see an odd clipping effect starting at zoom level ~13. Screenshots of the rendering below:


I think a good incremental step to a full angularjs + google maps example is getting a react + google maps example working, would appreciate any thoughts.
@rpk
- I played around with the react google map repo a bit.
- The behavior I see is that the deck.gl overlay stays in synch but gets clipped.
- As far as I can tell, it is the
OverlayViewcomponent that does the clipping. Not sure how to get around it. I get the impression it assumes that it is positioning a finitely sized DOM element on top of the map, not a dynamic overlay like deck.gl. - Not sure if there is a more appropriate type of overlay component
I tried to do the integration in a more deck.gl suitable way - listening to the center change events from the map and drawing deck.gl as a peer component of the map.
It works but there is a lag - the map moves first and then the overlay.
One approach could be to not let Google Maps control the panning but use deck.gl's MapController and just force feed coordinates to both the map and deck.gl. This is the way the mapbox integration works and it ensures the two always get the same settings.
@ibgreen - thanks for taking a look! I'll give implementing MapController a try. I was worried that Google Maps would lag if the panning wasn't done in that layer.
I'll give implementing MapController a try
@rpk Sounds good. This might be the best example to get you started with MapController https://github.com/uber/deck.gl/blob/master/examples/without-map/app.js
We now have an example that renders deck.gl layers without React and Mapbox
@ibgreen I'm having trouble getting the pure-js implementation working right now, it is failing to resolve dependencies for prop-types, mjolnir.js, and a few others (oddly enough including luma.gl). Do I need to do something else to get it working outside of the deck.gl repo?
@rpk I suspect it depends on unpublished changes, so it needs to be run against (inside) the repo (npm run start-local).
I can try to publish a 4.2.0-alpha.7 later today, and make that example's package.json refer to the alpha version of deck.gl, that should solve it.
@rpk pure-js example from latest master, should now build and run cleanly after a reinstall.
Closing due to inactivity, please re-open if needed.
@ibgreen hi, i found that your given url link about "without React and Mapbox" has expired(404 not found ). Are there any other examples using deck.gl without react ?
Looks like these examples are newer alternatives: