Back out hack to setMapCenter and fix the problem in the right place.
authorTom Hughes <tom@compton.nu>
Thu, 5 Feb 2009 22:23:45 +0000 (22:23 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 5 Feb 2009 22:23:45 +0000 (22:23 +0000)
app/controllers/geocoder_controller.rb
public/javascripts/map.js

index 531cce4221df34b2d10155e3f872251113d9197c..18812689b4c2c8318d792993e6366987bdde479a 100644 (file)
@@ -29,7 +29,7 @@ class GeocoderController < ApplicationController
 
       if results_count == 1
         position = results.collect { |s| s[:results] }.compact.flatten[0]
-        page.call "setPosition", position[:lat], position[:lon], position[:zoom]
+        page.call "setPosition", position[:lat].to_f, position[:lon].to_f, position[:zoom].to_i
       else
         page.call "openSidebar"
       end
index 3b05b1d4a962861a53388a78190b72a97eeb1bef..c80ed2242c8147db90177925af3db63eacee971f 100644 (file)
@@ -132,7 +132,6 @@ function getMapCenter(center, zoom) {
 }
 
 function setMapCenter(center, zoom) {
-   zoom = parseInt(zoom);
    var numzoom = map.getNumZoomLevels();
    if (zoom >= numzoom) zoom = numzoom - 1;
    map.setCenter(center.clone().transform(epsg4326, map.getProjectionObject()), zoom);