Comunidad de diseño web y desarrollo en internet online

Problemas con Google maps API y Resize Stage

Citar            
MensajeEscrito el 09 Dic 2009 01:24 am
Hola,
Tengo un diseño basado en un liquid layout donde en cada "resize stage event" todo se posiciona en el centro.
Todos los contenidos de la página: menú, secciones... están dentro de un contenedor que es el que se recoloca en el centro.
Desde que he implementado la api de google maps, si estoy en la sección donde visualizo la api, cada vez que se redimensiona el browser, el contenedor de la página sale disparado y desaparece. El factor de desplazamiento depende del valor de zoom en el contructor de un nuevo punto de referencia:

Código ActionScript :

The_map.setCenter(new LatLng(40.427022,-3.757925), 2, MapType.NORMAL_MAP_TYPE);



El mapa está contenido en un Sprite.
si el valor del zoom es inicialmente 1, al redimensionar el browser, el mapa se centra en el browers, obviando cualquier referencia o método de reposicionamiento.
Si se aumenta ese valor, el contenedor general se desplaza a la izquierda de manera proporcional a ese valor.

Alguna idea de porqué sucede esto?.
Gracias.

RO

Por creacionro

10 de clabLevel



 

msie7
Citar            
MensajeEscrito el 10 Dic 2009 12:30 am
Hay otra persona en China que tiene el mismo problema! así que no estamos locos. Existe un problema con esta API.
Desde GotoAndLearn no dicen nada y desde el foro de Google, nada de nada.
Y aquí en Cristalab?.

Por creacionro

10 de clabLevel



 

msie7
Citar            
MensajeEscrito el 10 Dic 2009 01:17 am

Código ActionScript :

////////////////////////////////////////////////////////////////////////////////////////////////
public function resizeStage(e:Event):void {
   stageW = root.stage.stageWidth;
   stageH =root.stage.stageHeight;

   theGradient.width=stageW;
   theGradient.height=stageH;
                var theGroundDestinyX:int= (theGround.width - stageW) * -0.5;
   var theGroundDestinyY:int=stageH-theGround.height;

/////////// The_MasterCont es el holder del menú y de las secciones y es lo que desaparece cuando la API de google está activa
   var theMasterContX:int=(stageW/2)-(The_MasterCont.width/2);
   var theMasterContY:int=stageH/6;
   
   if (stageW>200 && stageH>300) {
   TweenLite.to(theGround,((theGround.y<theGroundDestinyY)?0:1),{x:theGroundDestinyX,y:theGroundDestinyY,delay: ((theGround.y<theGroundDestinyY)?0:0.5) , ease:Expo.easeOut});
//////////////////////////////////////////////////////*The folowing line is encharged of relocate the holder of the sections and the menu and is The_MasterCont what run away when the google API is ready depending on the zoom value of the setCenter.*/

   TweenLite.to(The_MasterCont,1,{x:theMasterContX,y:theMasterContY, ease:Expo.easeOut});
   }
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
//This is the code inside the class that creates the map

var mapCont:Sprite=new Sprite() ;
The_mapCont=mapCont;
The_section.addChild(mapCont);
var map:Map = new Map();
mapCont.addChild(map);
The_map=map;
map.key ="the number that I got";
The_map.setSize(new Point(300, 300));
The_map.addEventListener(MapEvent.MAP_READY, onMapReady,false);

function onMapReady(event:MapEvent):void {
                The_map.removeEventListener(MapEvent.MAP_READY, onMapReady,false);
                The_map.x=0;
   The_map.y=0;
                /////////////////////////////////// The following line crash the The_MasterCont position and the resize handler because the zoom value
   The_map.setCenter(new LatLng(40.427022,-3.757925), 2, MapType.NORMAL_MAP_TYPE);
                //////////////////////////////////
   The_map.addOverlay(new Marker(new LatLng(40.427022,-3.757925)));
   The_map.addControl(new OverviewMapControl());
           The_map.addControl(new MapTypeControl());
           The_map.addControl(new PositionControl());
           The_map.addControl(new ZoomControl());
}

Por creacionro

10 de clabLevel



 

msie7

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.