You will see the reason when you add this to configurePolygonOptions.prototype.setMap
:
alert('call of configurePolygonOptions.setMap');
Although polygonOptions.setMap
will not be called somewhere, the alert will appear.
The reason: when you supply polygonOptions
as argument to google.maps.Polygon
, all methods of polygonOptions
will overwrite the built-in methods of the google.maps.Polygon
.
Your custom setMap-function simply changes the property, what will have no effect after the Polygon-instance has been created, you must invoke the setter-method MVCObject instead:
this.set('map',map);
But the best solution would be to use method-names that don't compete with the built-in methods(when you must use your attempt at all, currently I don't see there any benefit).