[libchamplain] Fix the javascript demo



commit ccca7cc6b7b4279861529c9b8ee788bf1f25198f
Author: JiÅ?í Techet <techet gmail com>
Date:   Fri Apr 1 00:50:55 2011 +0200

    Fix the javascript demo

 demos/launcher.js |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/demos/launcher.js b/demos/launcher.js
index 8043d63..c5210ae 100755
--- a/demos/launcher.js
+++ b/demos/launcher.js
@@ -65,9 +65,10 @@ function map_view_button_release_cb (actor, event)
   if (event.button != 1 || event.click_count > 1)
     return false;
 
-  let[ok, lat, lon] = view.get_coords_from_event (event);
-  if (ok)
-    log ("Map clicked at %f, %f \n", lat, lon);
+  let lat = view.y_to_latitude (event.y);
+  let lon = view.x_to_longitude (event.x);
+
+  log ("Map clicked at %f, %f \n", lat, lon);
 
   return true;
 }
@@ -125,7 +126,7 @@ view.connect ("button-release-event", Lang.bind (view,
 
 /* Finish initialising the map view */
 view.zoom_level = 12;
-view.scroll_mode = Champlain.ScrollMode.KINETIC;
+view.kinetic_mode = true;
 view.center_on (45.466, -73.75);
 
 stage.show ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]