question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for OverlayMapTypes ?

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
tomchentwcommented, Sep 6, 2017

We should extend the Overlay API to support this. PRs welcomed

0reactions
cuongdevjscommented, Mar 3, 2020

Any update for ImageMapType?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Overlay Map Types | Maps JavaScript API - Google Developers
This example uses a tile overlay MapType to overlay the map's tile coordinates on top of the default map tiles. Read the documentation....
Read more >
react-google-maps OverlayMapType support - Stack Overflow
I'm trying to implement an ImageMapType as an overlay using react-google-maps. This works fine on vanilla Google Maps as per the documentation.
Read more >
Refresh overlayMapTypes (i.e. force call getTile for visible tiles)
Hi all, I have a custom overlayMapType which will add markers from inside the getTile function. However, this custom map type can be...
Read more >
How to set up the layer order with Google Maps API?
overlayMapTypes.insertAt(order_layer ,layer[layer_name]); }. just call this function for add and order layer from your setting on your object layer.
Read more >
Variable opacity for Image Map Type layer [35820290]
wmsOptions.opacity = new Val; //wmsOptions is global wmsMapType = new google.maps.ImageMapType(wmsOptions); map.overlayMapTypes.setAt(0, wmsMapType); ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found