gmap: fix regression from 151058945234 stable
authorJulien Cristau <julien.cristau@logilab.fr>
Tue, 17 Jan 2012 11:47:14 +0100
branchstable
changeset 8164 1de67012837b
parent 8160 e53c003e3d37
child 8165 1fe089765187
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 13:04:59 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 13:04:59 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):