route360 / r360-js

Route360° JavaScript API (now Targomo)
https://www.targomo.com/developers/
MIT License
174 stars 37 forks source link

setMap to null on polygon gives an zoom error #16

Closed kafura closed 8 years ago

kafura commented 9 years ago

If I sets the map on a polygon to null, then it gives me an error when i'm zooming.

var polygon = new GoogleMapsPolygonLayer(<google map>);
polygon.setMap(null);

The error is:

Uncaught TypeError: Cannot read property 'getDiv' of null

image

I am trying to hide the polygon, is it the wrong way i'm doing it?

silberjan commented 8 years ago

Consoder using polygon.div_.style.visibility = 'hidden';

GoogleMapsPolygonLayer extends google.maps.OverlayView() for further information on how to hide such an overlay please refer to https://developers.google.com/maps/documentation/javascript/examples/overlay-hideshow?hl=de