From 554614723a94ca05ae8dc3a23fa7a8fa8419ff08 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 5 Feb 2009 22:23:45 +0000 Subject: [PATCH] Back out hack to setMapCenter and fix the problem in the right place. --- app/controllers/geocoder_controller.rb | 2 +- public/javascripts/map.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) 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); -- 2.43.2