[Commits] r1550 - sandbox/cmoullet/ux/GoogleEarthPanel/ux/widgets

commits at geoext.org commits at geoext.org
Fri Dec 4 07:50:27 CET 2009


Author: cmoullet
Date: 2009-12-04 07:50:27 +0100 (Fri, 04 Dec 2009)
New Revision: 1550

Modified:
   sandbox/cmoullet/ux/GoogleEarthPanel/ux/widgets/GoogleEarthPanel.js
Log:
bugfixing: store position / improve lookTo

Modified: sandbox/cmoullet/ux/GoogleEarthPanel/ux/widgets/GoogleEarthPanel.js
===================================================================
--- sandbox/cmoullet/ux/GoogleEarthPanel/ux/widgets/GoogleEarthPanel.js	2009-12-04 06:19:43 UTC (rev 1549)
+++ sandbox/cmoullet/ux/GoogleEarthPanel/ux/widgets/GoogleEarthPanel.js	2009-12-04 06:50:27 UTC (rev 1550)
@@ -568,6 +568,7 @@
      */
     onFrameEnd: function() {
         var lookAt = this.ge.getView().copyAsLookAt(this.altitudeMode);
+        this.lookAt = new OpenLayers.LonLat(lookAt.getLongitude(), lookAt.getLatitude());
         this.range = lookAt.getRange();
         this.til = lookAt.getTilt();
         this.heading = lookAt.getHeading();
@@ -585,14 +586,15 @@
     lookTo: function(lonLat) {
         if (!this.ge) {
             return;
+        } else {
+            if (this.ge.getNavigationControl().getVisibility() == this.ge.VISIBILITY_SHOW) {
+                this.transformToGE(lonLat);
+                var lookAt = this.ge.getView().copyAsLookAt(this.altitudeMode);
+                lookAt.setLongitude(lonLat.lon);
+                lookAt.setLatitude(lonLat.lat);
+                this.ge.getView().setAbstractView(lookAt);
+            }
         }
-
-        this.transformToGE(lonLat);
-
-        var lookAt = this.ge.getView().copyAsLookAt(this.altitudeMode);
-        lookAt.setLongitude(lonLat.lon);
-        lookAt.setLatitude(lonLat.lat);
-        this.ge.getView().setAbstractView(lookAt);
     },
 
     /**



More information about the Commits mailing list