[Commits] r1553 - in sandbox/cmoullet/ux/GoogleEarthPanel: examples ux/widgets

commits at geoext.org commits at geoext.org
Fri Dec 4 08:29:20 CET 2009


Author: cmoullet
Date: 2009-12-04 08:29:20 +0100 (Fri, 04 Dec 2009)
New Revision: 1553

Modified:
   sandbox/cmoullet/ux/GoogleEarthPanel/examples/GoogleEarthPanelExample.js
   sandbox/cmoullet/ux/GoogleEarthPanel/ux/widgets/GoogleEarthPanel.js
Log:
per default, atke the map center has lookAt

Modified: sandbox/cmoullet/ux/GoogleEarthPanel/examples/GoogleEarthPanelExample.js
===================================================================
--- sandbox/cmoullet/ux/GoogleEarthPanel/examples/GoogleEarthPanelExample.js	2009-12-04 06:52:02 UTC (rev 1552)
+++ sandbox/cmoullet/ux/GoogleEarthPanel/examples/GoogleEarthPanelExample.js	2009-12-04 07:29:20 UTC (rev 1553)
@@ -75,7 +75,6 @@
         xtype: 'gxux_googleearthpanel',
         id: 'googleEarthPanelItem',
         map: map,
-        lookAt: lookAt.transform(new OpenLayers.Projection("EPSG:900913"),new OpenLayers.Projection("EPSG:4326")),
         altitude: 50,
         heading: -60,
         tilt: 70,

Modified: sandbox/cmoullet/ux/GoogleEarthPanel/ux/widgets/GoogleEarthPanel.js
===================================================================
--- sandbox/cmoullet/ux/GoogleEarthPanel/ux/widgets/GoogleEarthPanel.js	2009-12-04 06:52:02 UTC (rev 1552)
+++ sandbox/cmoullet/ux/GoogleEarthPanel/ux/widgets/GoogleEarthPanel.js	2009-12-04 07:29:20 UTC (rev 1553)
@@ -8,6 +8,10 @@
 
 Ext.namespace('GeoExt.ux');
 
+// TODO: permalink manage in this class
+// TODO: add kml layer (see ticket)
+// TODO: improve hide / show and persistence of parameters
+
 GeoExt.ux.GoogleEarthPanel = Ext.extend(Ext.Panel, {
 
     /** api: config[map]
@@ -68,11 +72,12 @@
 
     /** api: config[lookAt]
      *  `` OpenLayers.LonLat``  Initial camera position (default: 0,0)
+     *  Take the map center if nothing is defined
      */
     /** private: property[lookAt]
      *  ``OpenLayers.LonLat``  Initial camera position
      */
-    lookAt: new OpenLayers.LonLat(0, 0),
+    lookAt: null,
 
     /** api: config[altitude]
      *  Initial altitude (default: 100)
@@ -166,6 +171,12 @@
 
         // Set Google Earth Properties
         this.ge.getWindow().setVisibility(true);
+
+        if (!this.lookAt) {
+            this.lookAt = this.map.getCenter();
+            this.transformToGE(this.lookAt);
+        }
+        
         this.setLookAt(this.lookAt.lat,
                 this.lookAt.lon,
                 this.altitude,
@@ -173,6 +184,7 @@
                 this.heading,
                 this.tilt,
                 this.range);
+
         this.ge.getNavigationControl().setVisibility(this.ge.VISIBILITY_SHOW);
         this.ge.getOptions().setFlyToSpeed(this.ge.SPEED_TELEPORT);
         this.manageLayers();



More information about the Commits mailing list