gmap: fix regression from 151058945234
authorJulien Cristau <julien.cristau@logilab.fr>
Tue, 17 Jan 2012 11:47:14 +0100
changeset 8163 f0a0bfc4a0c8
parent 8162 d5b02af28125
child 8170 8663f451c763
gmap: fix regression from 151058945234 Send zoomlevel as an int, and move closing brace to the right place.
web/data/cubicweb.gmap.js
web/views/igeocodable.py
--- a/web/data/cubicweb.gmap.js	Thu Jan 12 18:17:19 2012 +0100
+++ b/web/data/cubicweb.gmap.js	Tue Jan 17 11:47:14 2012 +0100
@@ -35,13 +35,13 @@
                     zoomLevel = geodata.zoomlevel;
                 } else {
                     zoomLevel = map.getBoundsZoomLevel( latlngbounds ) - 1;
+                }
                 if (geodata.center) {
                     center = new GLatng(geodata.center.latitude, geodata.center.longitude);
                 } else {
                     center = latlngbounds.getCenter();
                 }
                 map.setCenter(center, zoomLevel);
-                }
                 for (var i = 0; i < geodata.markers.length; i++) {
                     var marker = geodata.markers[i];
                     self.createMarker(map, marker, i + 1, uselabel);
--- a/web/views/igeocodable.py	Thu Jan 12 18:17:19 2012 +0100
+++ b/web/views/igeocodable.py	Tue Jan 17 11:47:14 2012 +0100
@@ -80,7 +80,7 @@
             'markers': markers,
             }
         if zoomlevel:
-            geodata['zoomlevel'] = zoomlevel
+            geodata['zoomlevel'] = int(zoomlevel)
         self.w(json_dumps(geodata))
 
     def build_marker_data(self, entity, igeocodable, extraparams):