[Commits] r2567 - in sandbox/cmoullet/ux/Profile: examples lib/GeoExt.ux

commits at geoext.org commits at geoext.org
Tue Jan 18 06:04:49 CET 2011


Author: cmoullet
Date: 2011-01-18 06:04:49 +0100 (Tue, 18 Jan 2011)
New Revision: 2567

Modified:
   sandbox/cmoullet/ux/Profile/examples/profile.js
   sandbox/cmoullet/ux/Profile/lib/GeoExt.ux/ProfileAction.js
   sandbox/cmoullet/ux/Profile/lib/GeoExt.ux/ProfileBox.js
Log:
Improved interaction

Modified: sandbox/cmoullet/ux/Profile/examples/profile.js
===================================================================
--- sandbox/cmoullet/ux/Profile/examples/profile.js	2011-01-16 18:31:57 UTC (rev 2566)
+++ sandbox/cmoullet/ux/Profile/examples/profile.js	2011-01-18 05:04:49 UTC (rev 2567)
@@ -7,7 +7,8 @@
 
     var profileAction = new GeoExt.ux.Profile({
         map: map,
-        profileService: 'api.geo.admin.ch'
+        profileService: 'api.geo.admin.ch',
+        profileInteractionEvent: "jqplotMouseMove"
     });
 
     var profileActionPanel = new GeoExt.ux.Profile({

Modified: sandbox/cmoullet/ux/Profile/lib/GeoExt.ux/ProfileAction.js
===================================================================
--- sandbox/cmoullet/ux/Profile/lib/GeoExt.ux/ProfileAction.js	2011-01-16 18:31:57 UTC (rev 2566)
+++ sandbox/cmoullet/ux/Profile/lib/GeoExt.ux/ProfileAction.js	2011-01-18 05:04:49 UTC (rev 2567)
@@ -56,6 +56,10 @@
      *  ``Number`` Optional. Height of the profile, default: 600
      */
 
+    /** api: config[profileInteractionEvent]
+     *  ``String`` Optional. Event (jqplotMouseMove, jqplotClick, jqplotDblClick or jqplotRightClick) that will present a marker in a map, default: jqplotClick
+     */
+
     /** api: config[samples]
      *  ``Number`` Optional. number of elevation points used to create the profile, default: 200
      */
@@ -88,6 +92,7 @@
         {samples: 200,
             profileWidth: 800,
             profileHeight: 600,
+            profileInteractionEvent: "jqplotClick",
             text: OpenLayers.i18n('Profile'),
             styleMarker: new OpenLayers.Style(
                     OpenLayers.Feature.Vector.style["default"]).defaultStyle});
@@ -176,6 +181,7 @@
                 height:this.profileHeight,
                 items: new GeoExt.ux.ProfileBox({
                     map: this.map,
+                    profileInteractionEvent: this.profileInteractionEvent,
                     profileData: this._profileData,
                     feature: this._drawControl.digitizedFeature,
                     profileModels: this._profileModels.split(','),
@@ -194,6 +200,7 @@
                 items: new GeoExt.ux.ProfileBox({
                     map: this.map,
                     profileData: this._profileData,
+                    profileInteractionEvent: this.profileInteractionEvent,
                     feature: this._drawControl.digitizedFeature,
                     profileModels: this._profileModels.split(','),
                     vector: this.vector,

Modified: sandbox/cmoullet/ux/Profile/lib/GeoExt.ux/ProfileBox.js
===================================================================
--- sandbox/cmoullet/ux/Profile/lib/GeoExt.ux/ProfileBox.js	2011-01-16 18:31:57 UTC (rev 2566)
+++ sandbox/cmoullet/ux/Profile/lib/GeoExt.ux/ProfileBox.js	2011-01-18 05:04:49 UTC (rev 2567)
@@ -213,7 +213,7 @@
         });
         plot1.profileBox = this;
 
-        $("#" + this.jqueryDiv.id).bind("jqplotClick", function(ev, gridpos, datapos, neighbor, plot) {
+        $("#" + this.jqueryDiv.id).bind(this.profileInteractionEvent, function(ev, gridpos, datapos, neighbor, plot) {
             plot.profileBox.deleteMarker();
             if (plot.profileBox.realmaxX > datapos.xaxis) {
                 // Get the position
@@ -227,6 +227,12 @@
                 }
             }
         });
+
+        $("#" + this.jqueryDiv.id).bind("jqplotMouseLeave", function(ev, gridpos, datapos, neighbor, plot) {
+            plot.profileBox.deleteMarker();
+        });
+
+
     }
 });
 



More information about the Commits mailing list