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.

Property mapPanes is null

See original GitHub issue

Hello,

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:closed
  • Created 7 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
techsevcommented, Jan 13, 2017

this solves the error messages BUT causes flickering on any setState that rerenders the map.

0reactions
tomchentwcommented, Apr 20, 2017

Please refer to Getting Help section in the README (or #469).

Read more comments on GitHub >

github_iconTop 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 >

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