mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +00:00
Merge pull request #1062 from mtmail/display-viewbox-on-map
Display viewbox on map
This commit is contained in:
@@ -11,4 +11,5 @@
|
|||||||
<script src="js/bootstrap.min.js"></script>
|
<script src="js/bootstrap.min.js"></script>
|
||||||
<script src="js/leaflet.min.js"></script>
|
<script src="js/leaflet.min.js"></script>
|
||||||
<script src="js/Control.Minimap.min.js"></script>
|
<script src="js/Control.Minimap.min.js"></script>
|
||||||
|
<script src="js/url-search-params.js"></script>
|
||||||
<script src="js/nominatim-ui.js"></script>
|
<script src="js/nominatim-ui.js"></script>
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
.leaflet-container .leaflet-tile-pane img,
|
.leaflet-container .leaflet-tile-pane img,
|
||||||
.leaflet-container img.leaflet-image-layer {
|
.leaflet-container img.leaflet-image-layer {
|
||||||
max-width: none !important;
|
max-width: none !important;
|
||||||
|
max-height: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-container.leaflet-touch-zoom {
|
.leaflet-container.leaflet-touch-zoom {
|
||||||
@@ -55,11 +56,20 @@
|
|||||||
}
|
}
|
||||||
.leaflet-container.leaflet-touch-drag {
|
.leaflet-container.leaflet-touch-drag {
|
||||||
-ms-touch-action: pinch-zoom;
|
-ms-touch-action: pinch-zoom;
|
||||||
}
|
/* Fallback for FF which doesn't support pinch-zoom */
|
||||||
|
touch-action: none;
|
||||||
|
touch-action: pinch-zoom;
|
||||||
|
}
|
||||||
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
|
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
|
||||||
-ms-touch-action: none;
|
-ms-touch-action: none;
|
||||||
touch-action: none;
|
touch-action: none;
|
||||||
}
|
}
|
||||||
|
.leaflet-container {
|
||||||
|
-webkit-tap-highlight-color: transparent;
|
||||||
|
}
|
||||||
|
.leaflet-container a {
|
||||||
|
-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
|
||||||
|
}
|
||||||
.leaflet-tile {
|
.leaflet-tile {
|
||||||
filter: inherit;
|
filter: inherit;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
@@ -303,7 +313,14 @@
|
|||||||
height: 30px;
|
height: 30px;
|
||||||
line-height: 30px;
|
line-height: 30px;
|
||||||
}
|
}
|
||||||
|
.leaflet-touch .leaflet-bar a:first-child {
|
||||||
|
border-top-left-radius: 2px;
|
||||||
|
border-top-right-radius: 2px;
|
||||||
|
}
|
||||||
|
.leaflet-touch .leaflet-bar a:last-child {
|
||||||
|
border-bottom-left-radius: 2px;
|
||||||
|
border-bottom-right-radius: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
/* zoom control */
|
/* zoom control */
|
||||||
|
|
||||||
@@ -312,16 +329,10 @@
|
|||||||
font: bold 18px 'Lucida Console', Monaco, monospace;
|
font: bold 18px 'Lucida Console', Monaco, monospace;
|
||||||
text-indent: 1px;
|
text-indent: 1px;
|
||||||
}
|
}
|
||||||
.leaflet-control-zoom-out {
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.leaflet-touch .leaflet-control-zoom-in {
|
.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
}
|
}
|
||||||
.leaflet-touch .leaflet-control-zoom-out {
|
|
||||||
font-size: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* layers control */
|
/* layers control */
|
||||||
@@ -359,6 +370,7 @@
|
|||||||
}
|
}
|
||||||
.leaflet-control-layers-scrollbar {
|
.leaflet-control-layers-scrollbar {
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
|
overflow-x: hidden;
|
||||||
padding-right: 5px;
|
padding-right: 5px;
|
||||||
}
|
}
|
||||||
.leaflet-control-layers-selector {
|
.leaflet-control-layers-selector {
|
||||||
|
|||||||
14
website/js/leaflet.min.js
vendored
14
website/js/leaflet.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -249,6 +249,14 @@ jQuery(document).ready(function(){
|
|||||||
$('form input[name=lon]').val(lat);
|
$('form input[name=lon]').val(lat);
|
||||||
$('form').submit();
|
$('form').submit();
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
var search_params = new URLSearchParams(location.search);
|
||||||
|
var viewbox = search_params.get('viewbox');
|
||||||
|
if (viewbox) {
|
||||||
|
var coords = viewbox.split(','); // <x1>,<y1>,<x2>,<y2>
|
||||||
|
var bounds = L.latLngBounds([coords[1], coords[0]], [coords[3], coords[2]]);
|
||||||
|
L.rectangle(bounds, {color: "#69d53e", weight: 3, dashArray: '5 5', opacity: 0.8, fill: false}).addTo(map);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
highlight_result(0, false);
|
highlight_result(0, false);
|
||||||
|
|||||||
2
website/js/url-search-params.js
Normal file
2
website/js/url-search-params.js
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user