[Commits] r1499 - in sandbox/cmoullet/ux/StreetViewPanel/ux: control widgets

commits at geoext.org commits at geoext.org
Thu Nov 26 06:05:03 CET 2009


Author: cmoullet
Date: 2009-11-26 06:05:03 +0100 (Thu, 26 Nov 2009)
New Revision: 1499

Modified:
   sandbox/cmoullet/ux/StreetViewPanel/ux/control/Click.js
   sandbox/cmoullet/ux/StreetViewPanel/ux/widgets/StreetViewPanel.js
Log:
Add doc + support of camera orientation


Modified: sandbox/cmoullet/ux/StreetViewPanel/ux/control/Click.js
===================================================================
--- sandbox/cmoullet/ux/StreetViewPanel/ux/control/Click.js	2009-11-26 04:15:11 UTC (rev 1498)
+++ sandbox/cmoullet/ux/StreetViewPanel/ux/control/Click.js	2009-11-26 05:05:03 UTC (rev 1499)
@@ -41,7 +41,8 @@
                 } else if (data.code == 500) {
                     alert(OpenLayers.i18n('Google Street View: Server error'));
                 } else if (data.code == 200) {
-                    this.panorama.setLocationAndPOV(data.location.latlng);
+                    var POV = {yaw: this.yaw,  pitch: this.pitch, zoom: this.zoom};
+                    this.panorama.setLocationAndPOV(data.location.latlng, POV);
                 } else {
                     alert(OpenLayers.i18n('Google Street View: Unexpected problem'));
                 }

Modified: sandbox/cmoullet/ux/StreetViewPanel/ux/widgets/StreetViewPanel.js
===================================================================
--- sandbox/cmoullet/ux/StreetViewPanel/ux/widgets/StreetViewPanel.js	2009-11-26 04:15:11 UTC (rev 1498)
+++ sandbox/cmoullet/ux/StreetViewPanel/ux/widgets/StreetViewPanel.js	2009-11-26 05:05:03 UTC (rev 1499)
@@ -9,17 +9,76 @@
 Ext.namespace('GeoExt.ux');
 
 GeoExt.ux.StreetViewPanel = Ext.extend(Ext.Panel, {
+    /** api: config[map]
+     *  ``OpenLayers.Map or Object``  A configured map or a configuration object
+     *  for the map constructor
+     */
+    /** private: property[map]
+     *  ``OpenLayers.Map``  The map object.
+     */
+    map: null,
 
+    /** api: config[panorama]
+     *  ``GStreetviewPanorama``  A GStreetviewPanorama object holds an instance of the Flash® Street View Panorama viewer.
+     */
+    /** private: property[panorama]
+     *  ``GStreetviewPanorama``  The panorama object.
+     */
+    panorama: null,
+
+    /** api: config[streetviewclient]
+     *  ``GStreetviewClient``  A GStreetviewClient object performs searches for Street View data based on parameters that are passed to its methods.
+     */
+    /** private: property[streetviewclient]
+     *  ``GStreetviewClient``  The Street View Client object.
+     */
+    streetviewclient: null,
+
+    /** api: config[clickMode]
+     *  ``Boolean``  Defines if the panorama is selected through a click in the map
+     */
+    /** private: property[clickMode]
+     *  ``Boolean``  Is click mode active ?
+     */
+    clickMode: true,
+
+    /** api: config[toolMode]
+     *  ``Boolean``  Defines if the 2D tool is shown in the map
+     */
+    /** private: property[toolMode]
+     *  ``Boolean``  Is tool visible ?
+     */
+    toolMode: true,
+
+    /** api: config[yaw]
+     *  ``Number``  The camera yaw in degrees relative to true north. True north is 0 degrees, east is 90 degrees, south is 180 degrees, west is 270 degrees.
+     */
+    /** private: property[180]
+     *  ``Number``  Camery yaw
+     */
+    yaw: 180,
+
+    /** api: config[pitch]
+     *  ``Number``  The camera pitch in degrees, relative to the street view vehicle. Ranges from 90 degrees (directly upwards) to -90 degrees (directly downwards). 
+     */
+    /** private: property[180]
+     *  ``Number``  Camery pitch
+     */
+    pitch: 0,
+
+    /** api: config[zoom]
+     *  ``Number``  The zoom level. Fully zoomed-out is level 0, zooming in increases the zoom level.
+     */
+    /** private: property[180]
+     *  ``Number``  Panorama zoom level
+     */
+    zoom: 0,
+
     initComponent : function() {
 
         var defConfig = {
             plain: true,
-            zoomLevel: 3,
-            yaw: 180,
-            pitch: 0,
-            zoom: 0,
-            border: false,
-            mode: 'clickMode'
+            border: false
         };
 
         Ext.applyIf(this, defConfig);
@@ -38,13 +97,16 @@
         this.panorama = new GStreetviewPanorama(this.body.dom);
         this.streetviewclient = new GStreetviewClient();
         if (this.map) {
-            if (this.mode == 'clickMode') {
+            if (this.clickMode) {
                 this.clickControl = new GeoExt.ux.Click({
                     handlerOptions: {
                         "single": true
                     },
                     panorama: this.panorama,
-                    streetviewclient: this.streetviewclient
+                    streetviewclient: this.streetviewclient,
+                    yaw: this.yaw,
+                    pitch: this.pitch,
+                    level: this.level 
                 });
                 this.map.addControl(this.clickControl);
                 this.clickControl.activate();
@@ -53,7 +115,7 @@
     },
 
     beforeDestroy: function() {
-        if (this.mode == 'clickMode') {
+        if (this.clickMode) {
             if (this.map) {
                 this.clickControl.deactivate();
                 this.map.removeControl(this.clickControl);
@@ -66,15 +128,19 @@
 
     onResize : function(w, h) {
         GeoExt.ux.StreetViewPanel.superclass.onResize.call(this, w, h);
-        if (typeof this.panorama == 'object') {
-            this.panorama.checkResize();
+        if (this.panorama) {
+            if (typeof this.panorama == 'object') {
+                this.panorama.checkResize();
+            }
         }
     },
 
     setSize : function(width, height, animate) {
         GeoExt.ux.StreetViewPanel.superclass.setSize.call(this, width, height, animate);
-        if (typeof this.panorama == 'object') {
-            this.panorama.checkResize();
+        if (this.panorama) {
+            if (typeof this.panorama == 'object') {
+                this.panorama.checkResize();
+            }
         }
     }
 });



More information about the Commits mailing list