Revert "search: draw a marker highlighting search results (rectangle for region, 10px circle for point)"
This reverts commit 39e4608c4e1ce8f221af2c70da3d6396cc370262.
This commit is contained in:
parent
1ac5158dcf
commit
7fd88dd1e3
@ -15,17 +15,9 @@ window.setupGeosearch = function() {
|
|||||||
map.locate({setView : true, maxZoom: 13});
|
map.locate({setView : true, maxZoom: 13});
|
||||||
});
|
});
|
||||||
$('#geosearch').keyup(function(){$(this).removeClass('search_not_found')});
|
$('#geosearch').keyup(function(){$(this).removeClass('search_not_found')});
|
||||||
|
|
||||||
window.searchResultLayer = L.layerGroup();
|
|
||||||
map.addLayer(window.searchResultLayer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
window.search = function(search) {
|
window.search = function(search) {
|
||||||
window.searchResultLayer.clearLayers();
|
|
||||||
|
|
||||||
var searchMarkerOptions = {color:'red', weight:3, opacity: 0.5, fill:false, dashArray:"5,5", clickable:false};
|
|
||||||
|
|
||||||
|
|
||||||
if (!runHooks('geoSearch', search)) {
|
if (!runHooks('geoSearch', search)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -35,12 +27,7 @@ window.search = function(search) {
|
|||||||
if(!isNaN(ll[0]) && !isNaN(ll[1])) {
|
if(!isNaN(ll[0]) && !isNaN(ll[1])) {
|
||||||
ll = [parseFloat(ll[0]), parseFloat(ll[1])];
|
ll = [parseFloat(ll[0]), parseFloat(ll[1])];
|
||||||
if(ll[0] >= -90 && ll[0] <= 90 && ll[1] >= -180 && ll[1] <= 180) {
|
if(ll[0] >= -90 && ll[0] <= 90 && ll[1] >= -180 && ll[1] <= 180) {
|
||||||
var ll = L.latLng(ll);
|
window.map.setView(L.latLng(ll[0], ll[1]), 17);
|
||||||
window.map.setView(ll, 17);
|
|
||||||
|
|
||||||
window.searchResultLayer.clearLayers();
|
|
||||||
window.searchResultLayer.addLayer(L.circleMarker(ll,searchMarkerOptions));
|
|
||||||
|
|
||||||
if(window.isSmartphone()) window.show('map');
|
if(window.isSmartphone()) window.show('map');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -57,14 +44,6 @@ window.search = function(search) {
|
|||||||
var southWest = new L.LatLng(b[0], b[2]),
|
var southWest = new L.LatLng(b[0], b[2]),
|
||||||
northEast = new L.LatLng(b[1], b[3]),
|
northEast = new L.LatLng(b[1], b[3]),
|
||||||
bounds = new L.LatLngBounds(southWest, northEast);
|
bounds = new L.LatLngBounds(southWest, northEast);
|
||||||
|
|
||||||
window.searchResultLayer.clearLayers();
|
|
||||||
if (southWest.equals(northEast)) {
|
|
||||||
window.searchResultLayer.addLayer(L.circleMarker(southWest,searchMarkerOptions));
|
|
||||||
} else {
|
|
||||||
window.searchResultLayer.addLayer(L.rectangle(bounds,searchMarkerOptions));
|
|
||||||
}
|
|
||||||
|
|
||||||
window.map.fitBounds(bounds, {maxZoom: 17});
|
window.map.fitBounds(bounds, {maxZoom: 17});
|
||||||
if(window.isSmartphone()) window.show('map');
|
if(window.isSmartphone()) window.show('map');
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user