Property mapPanes is null
See original GitHub issueHello,
I have a problem with overlayView - a property mapPanes becomes null when a component is rerendered (by incoming items that create new overlayViews) and i am still giving this error message:
TypeError: Cannot read property 'overlayMouseTarget' of null
from react-google-maps/lib/utils/OverlayViewHelper in mountContainerElementToPane
Here is my code:
const clusterMarkers = cluster && cluster.map((x, key) => <OverlayView
position={{ lat: x.lat, lng: x.lng }}
mapPaneName={OverlayView.OVERLAY_MOUSE_TARGET}
getPixelPositionOffset={getPixelPositionOffset}
key={key}
>
<div onClick={...}>
{x.title}
</div>
</OverlayView>);
<GoogleMap
ref={setMap}
center={c}
zoom={z}
onZoomChanged={zoomChangedHandler}
onDragEnd={centerChangedHandler}
>
{clusterMarkers}
</GoogleMap>
Please, do you have any idea to fix it?
I am using v6.0.0
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
cannot read property of null (googlemaps) - even though I ...
I have a script for google maps which renders me a map on predetermined coords, uses info in the marker array from the...
Read more >Open a MapPane - Esri Community
The problem is that only the MapPane that is currently active has a map, for all the others the map property is null....
Read more >DOM elements | Maps JavaScript API - Google Developers
Return Value: MapPanes|null. Returns the panes in which this OverlayView can be rendered. The panes are not initialized until onAdd is called by...
Read more >TypeError: Cannot read property 'map' of null in React.js
The "cannot read property 'map' of null" error occurs when we call the `map()` method on a `null` value, most often when initializing...
Read more >ExportWebMap specification—ArcGIS Server
The object mapOptions is required and defines map display properties. ... If this field is null or missing, then only the latest observation...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
this solves the error messages BUT causes flickering on any setState that rerenders the map.
Please refer to Getting Help section in the README (or #469).