Hi,
I need to add a custom control to the BOTTOM_RIGHT corner of the map.
map.controls[google.maps.ControlPosition.BOTTOM_RIGHT].push(controlDiv);
But this is not working in Google maps V3 because it will be displayed
to the left of the terms of use text every time, regardless if I set
the index of the control or not.
controlDiv.index = 0;
map.controls[google.maps.ControlPosition.BOTTOM_RIGHT].push(controlDiv);
I couldn't find a solution in this forum but it is not the first time
this question has been asked, so maybe someone has a solution for
this, would be very nice!
By the way, is there a nice and safe way to remove a custom control?
At the moment I iterate the controls[..] collection and check if the
control is the same object or has the same id and then try to remove
the control at the current position/index
map.controls[google.maps.ControlPosition.BOTTOM_RIGHT].forEach(function(element,
index) {
if (element == controlDiv) {
map.controls[google.maps.ControlPosition.BOTTOM_RIGHT].removeAt(index);
}
});
Is this correct? I personally don't like such code in JavaScript... it
is not fail safe at all
Thanks.
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.