Eventually i added a redraw function to the preloader class to facilitate
the move, its being called onresize.
/**
* Move the control to the center of the map.
**/
this.redraw = function() {
var xy =
this._oMap.fromLatLngToContainerPixel(this._oMap.getCenter());
this._oContainer.style.top = (xy.y -
Math.floor(this._oContainer.offsetHeight / 2)) + "px";
this._oContainer.style.left = (xy.x -
Math.floor(this._oContainer.offsetWidth / 2)) + "px";
}
Thanks for the help guys.
2008/9/3 Björn Brala <[EMAIL PROTECTED]>
> About the checkResize, it seems it does not update the position of my
> control, not by asking the control what his default position is. The default
> position is a function that calculates the screen center.
>
> Im currently coding a custom redraw like function that will move the
> control accordingly on resize. Hoepfully is works.
>
> 2008/9/2 Mike Williams <[EMAIL PROTECTED]>
>
>
>> If you're using a custom GControl, then I believe that when you call
>> map.checkResize(), all the control positions get recalculated.
>>
>> Note: posting a link to your .js file doesn't help. Always post a link
>> to the web page that contains your map.
>>
>> --
>> http://econym.googlepages.com/index.htm
>> The Blackpool Community Church Javascript Team
>>
>>
>> >>
>>
>
>
> --
> Bjorn Brala
> ----------------
> Google maps - Swis Webdesign
>
--
Bjorn Brala
----------------
Google maps - Swis Webdesign
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" 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-API?hl=en
-~----------~----~----~----~------~----~------~--~---