From: Tom Hughes Date: Thu, 5 Feb 2009 22:23:45 +0000 (+0000) Subject: Back out hack to setMapCenter and fix the problem in the right place. X-Git-Tag: live~7646 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/554614723a94ca05ae8dc3a23fa7a8fa8419ff08 Back out hack to setMapCenter and fix the problem in the right place. --- diff --git a/app/controllers/geocoder_controller.rb b/app/controllers/geocoder_controller.rb index 531cce422..18812689b 100644 --- a/app/controllers/geocoder_controller.rb +++ b/app/controllers/geocoder_controller.rb @@ -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 diff --git a/public/javascripts/map.js b/public/javascripts/map.js index 3b05b1d4a..c80ed2242 100644 --- a/public/javascripts/map.js +++ b/public/javascripts/map.js @@ -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);