parent
77e8a16a15
commit
11af851248
2 changed files with 4 additions and 23 deletions
|
@ -355,24 +355,4 @@ $(document).ready(function () {
|
|||
if (OSM.router.route(this.pathname + this.search + this.hash))
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$(".search_form").on("submit", function(e) {
|
||||
e.preventDefault();
|
||||
$("header").addClass("closed");
|
||||
var query = $(this).find("input[name=query]").val();
|
||||
if (query) {
|
||||
OSM.router.route("/search?query=" + encodeURIComponent(query) + OSM.formatHash(map));
|
||||
} else {
|
||||
OSM.router.route("/");
|
||||
}
|
||||
});
|
||||
|
||||
$(".describe_location").on("click", function(e) {
|
||||
e.preventDefault();
|
||||
var center = map.getCenter().wrap(),
|
||||
precision = OSM.zoomPrecision(map.getZoom());
|
||||
OSM.router.route("/search?query=" + encodeURIComponent(
|
||||
center.lat.toFixed(precision) + "," + center.lng.toFixed(precision)
|
||||
));
|
||||
});
|
||||
});
|
||||
|
|
|
@ -32,10 +32,11 @@ OSM.Search = function(map) {
|
|||
|
||||
$(".describe_location").on("click", function(e) {
|
||||
e.preventDefault();
|
||||
var precision = OSM.zoomPrecision(map.getZoom());
|
||||
var center = map.getCenter().wrap(),
|
||||
precision = OSM.zoomPrecision(map.getZoom());
|
||||
OSM.router.route("/search?query=" + encodeURIComponent(
|
||||
map.getCenter().lat.toFixed(precision) + "," +
|
||||
map.getCenter().lng.toFixed(precision)));
|
||||
center.lat.toFixed(precision) + "," + center.lng.toFixed(precision)
|
||||
));
|
||||
});
|
||||
|
||||
$("#sidebar_content")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue