-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Cannot remove a WebglOverlay that has not been set to a map #419
Comments
Hidden: off topic
I have seen those messages pop up as well, and have no Idea how they are caused. I'm suspecting this could happen if markers/advanced-markers are added and removed in very quick succession, which could have been caused by React re-rendering or re-mounting the marker component. It doesn't seem to impact the application (to me it looks like an error that the maps API should be handling internally) so I'm going to treat this with a lower priority. I'll keep this open and update once I found out what exactly is causing those errors. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Hi @usefulthink , I also run into this problem with advanced markers, but also in other places. For instance when I try out this example: const [isSelected, setSelected] = useState(false);
return (
<>
<div onClick={() => setSelected(!isSelected)}>Click me to change</div>
{isSelected &&
<div>is selected</div>
}
{!isSelected &&
<APIProvider apiKey={API_KEY}>
<Map
defaultCenter={{lat: 37.74, lng: -122.4}}
defaultZoom={11}
mapId={'xxxyyyzzz'}
gestureHandling={'greedy'}
disableDefaultUI={true}>
<DeckGlOverlay layers={getDeckGlLayers(data)} />
</Map>
<ControlPanel />
</APIProvider>
}
</>
); It seems to me to happen in a map_changed (callback) function where a getMap() call returns empty rather than the map, see minified code below: _.wn.prototype.map_changed = function() {
const a = async()=>{
let b = this.getMap();
if (b)
if (Fs.Dl(this, b),
_.Gs.has(this))
_.Gs.delete(this);
else {
const c = b.__gm.Eg;
await c.Mg;
await c.Kg;
const d = _.rn(c, "WEBGL_OVERLAY_VIEW");
if (!d.isAvailable && this.getMap() === b) {
for (const e of d.Eg)
c.log(e);
Fs.tl(this)
}
}
else
console.warn("Cannot remove a WebglOverlay that has not been set to a map"),
Fs.tl(this)
}
;
Fs ? a() : _.uk("webgl").then(b=>{
Fs = b;
a()
}
)
} Given the above, my guess is that it is related to using a WebglOverlay with the map in general (new GoogleMapsOverlay({interleaved: true})). |
The thing is, this has no immediate relation to anything we are doing with the maps API. That It could be something used internally by the AdvancedMarker implementation, maybe related to the collision-handling or something like that. I am in contact with folks at the google maps team about this. What would help the most in that context, would be a vanilla JS example that triggers this error, but I haven't yet had the time to investigate this further. It might be as simple as running |
As far as I am aware, this also doesn't affect applications built with this library (besides an annoying error-message in the console), am I wrong on that? |
same issue on my project too. it does not affect on any other functions though, I hope the issue to be solved anytime soon. |
my team and I are experiencing the same issue. there are destruction techniques not being properly handled by vis.gl, or at least being passed up for us as devs to handle |
@arithtic the problem here is that nobody seems to know what those techniques are, and where they are not being handled, can you elaborate? |
https://developers.google.com/maps/documentation/javascript/webgl/webgl-overlay-view @usefulthink That link above talks about how to correctly use and remove a webgl overlay. The warning/error shows that it is specifically related to this and must be because AdvancedMarker from vis.gl is using that google maps import incorrectly when destructing. |
Don't think this is something we can fix without directly using google.maps.WebGLOverlayView and the other raw JS library. vis,gl will need to address this I'm pretty sure |
The thing is, we're only using the I'm looking to reproduce this error-message without our library, which should tell us how this could be fixed in the library. |
@usefulthink The error is being caught at line 357 of maps-api-v3/api/js/57/9/intl/en_gb/main.js |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Turns out, the error-message can be easily reproduced with the vanilla API. I created an Issue in the maps issue tracker about this: https://issuetracker.google.com/issues/356878392 (please +1 the issue there to raise awareness) Also, while you're here, could you please have a quick look at this codesandbox and confirm that the warning-message is logged for you as well: (if you don't see the message in the console, please add a comment here with your browser / os / related error-messages) |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
I have this same problem too in my aplication. `const removerAllMarkers = () => { if (markerClusterer) { |
See #419 (comment) – it's an issue in the Maps API and there's nothing we can do about it on our end. Please upvote the issue in the google issue tracker if you are affected by this: https://issuetracker.google.com/issues/356878392 |
I just received a notification from the issue tracking system that this has been solved in the latest maps API version: https://issuetracker.google.com/issues/356878392 |
Description
Got the warning "Cannot remove a WebglOverlay that has not been set to a map " when using AdvancedMarker
Steps to Reproduce
Render the markers on the map by AdvancedMarker, got the warning (please see the below) from Chrome when leaving the page of the MAP
"Cannot remove a WebglOverlay that has not been set to a map"
Environment
Logs
The text was updated successfully, but these errors were encountered: