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