Having asked for a google.maps.KmlLayer, and whilst waiting for it to load, is it possible to cancel the request?

Calling layer.setMap(null); seems to causes an error if the layer is not yet visible.

I would like to be able to cancel the request for the layer, then ask for a different layer.


I am using version 3 of the google maps api.


Unfortunately no, it is not possible, at least via the API. Because it is all asynchronous, once the request is made there is no control over the request/response until the response (the KmlLayer) comes back.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.