parent
d792a3bab5
commit
67925e6d98
3 changed files with 5 additions and 3 deletions
|
@ -49,7 +49,7 @@ OSM.initializeContextMenu = function (map) {
|
|||
lat = latlng.lat.toFixed(precision),
|
||||
lng = latlng.lng.toFixed(precision);
|
||||
|
||||
OSM.router.route("/search?query=" + encodeURIComponent(lat + "," + lng));
|
||||
OSM.router.route("/search?whereami=1&query=" + encodeURIComponent(lat + "," + lng));
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ OSM.Search = function(map) {
|
|||
e.preventDefault();
|
||||
var center = map.getCenter().wrap(),
|
||||
precision = OSM.zoomPrecision(map.getZoom());
|
||||
OSM.router.route("/search?query=" + encodeURIComponent(
|
||||
OSM.router.route("/search?whereami=1&query=" + encodeURIComponent(
|
||||
center.lat.toFixed(precision) + "," + center.lng.toFixed(precision)
|
||||
));
|
||||
});
|
||||
|
|
|
@ -305,7 +305,9 @@ class GeocoderController < ApplicationController
|
|||
params.merge!(dms_to_decdeg(latlon)).delete(:query)
|
||||
|
||||
elsif latlon = query.match(/^\s*([+-]?\d+(\.\d*)?)\s*[\s,]\s*([+-]?\d+(\.\d*)?)\s*$/)
|
||||
params.merge!(:lat => latlon[1].to_f, :lon => latlon[3].to_f, :latlon_digits => true).delete(:query)
|
||||
params.merge!(:lat => latlon[1].to_f, :lon => latlon[3].to_f).delete(:query)
|
||||
|
||||
params[:latlon_digits] = true unless params[:whereami]
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue