Hi,
I have added a custom control like below:
var searchControlDiv = document.createElement('DIV');
var searchControl = new SearchControl(searchControlDiv, map);
searchControlDiv.index = 1;
map.controls[google.maps.ControlPosition.BOTTOM_CENTER].push(searchControlDiv);
Using the example here:
http://code.google.com/apis/maps/documentation/javascript/controls.html#CustomControls
When I try to remove using removeAt, I get error message:
>> Uncaught TypeError: Cannot read property 'parentNode' of undefined
Below is the line of code I am using to remove.
map.controls[google.maps.ControlPosition.BOTTOM_CENTER].removeAt(1);
clear works fine though:
map.controls[google.maps.ControlPosition.BOTTOM_CENTER].clear();
Please advice what am I doing wrong.
Thanks.