Back out hack to setMapCenter and fix the problem in the right place.
This commit is contained in:
parent
c1df8017d6
commit
554614723a
2 changed files with 1 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue