Back out hack to setMapCenter and fix the problem in the right place.

This commit is contained in:
Tom Hughes 2009-02-05 22:23:45 +00:00
parent c1df8017d6
commit 554614723a
2 changed files with 1 additions and 2 deletions

View 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

View 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);