I'm trying to implement an ImageMapType as an overlay. This works fine on vanilla Google Maps as per the documentation.
However with this library, there is no overlayMapTypes array in the returned map object:
handleMapLoad(map) {
this._map = map;
this._navOverlay = new google.maps.ImageMapType(NAV_OVERLAY_OPTIONS);
this._map.overlayMapTypes.push(this._navOverlay);
}
// throws error 'Cannot read property 'push' of undefined'
I did find an overlayMapTypes array inside map.context.__SECRET_MAP_DO_NOT_USE_OR_YOU_WILL_BE_FIRED but when I use that one, the map tiles are offset by a few degrees of latitude and longitude.
So how do I do it?
StackOverflow question: https://stackoverflow.com/questions/45664913/react-google-maps-overlaymaptype-support
We should extend the Overlay API to support this. PRs welcomed
@foucdeg I have a similar challenge than you. As a temporary workaround I used map.context.__SECRET_MAP_DO_NOT_USE_OR_YOU_WILL_BE_FIRED and didn't have any offset problems.
@tomchentw I'd like to work on extending the Overlay API to support overlayMapTypes. Since this is your component, I'd love to get some feedback on how you'd like to approach this.
Thanks!
BTW, v8.0.0 is released:
https://tomchentw.github.io/react-google-maps/#!/OverlayView
@pablocastellanos unfortunately my current "workaround" is react-leaflet. @tomchentw If I find some free time I'll look into the code to create a pull request.
OK. Close for now
Hello, has there been any support/implementation for ImageMapType? Thanks!
Any update for ImageMapType?
Most helpful comment
We should extend the Overlay API to support this. PRs welcomed