forked from hans/Nominatim
fix viewbox issues
This commit is contained in:
@@ -133,6 +133,12 @@
|
|||||||
$this->aViewBox = array($fLeft, $fBottom, $fRight, $fTop);
|
$this->aViewBox = array($fLeft, $fBottom, $fRight, $fTop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getViewBoxString()
|
||||||
|
{
|
||||||
|
if (!$this->aViewBox) return null;
|
||||||
|
return $this->aViewBox[0].','.$this->aViewBox[3].','.$this->aViewBox[2].','.$this->aViewBox[1];
|
||||||
|
}
|
||||||
|
|
||||||
function setRoute($aRoutePoints)
|
function setRoute($aRoutePoints)
|
||||||
{
|
{
|
||||||
$this->aRoutePoints = $aRoutePoints;
|
$this->aRoutePoints = $aRoutePoints;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
echo " timestamp='".date(DATE_RFC822)."'";
|
echo " timestamp='".date(DATE_RFC822)."'";
|
||||||
echo " attribution='Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright'";
|
echo " attribution='Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright'";
|
||||||
echo " querystring='".htmlspecialchars($sQuery, ENT_QUOTES)."'";
|
echo " querystring='".htmlspecialchars($sQuery, ENT_QUOTES)."'";
|
||||||
if (isset($_GET['viewbox']) && $_GET['viewbox']) echo " viewbox='".htmlspecialchars($_GET['viewbox'], ENT_QUOTES)."'";
|
if ($sViewBox) echo " viewbox='".htmlspecialchars($sViewBox, ENT_QUOTES)."'";
|
||||||
echo " polygon='".($bShowPolygons?'true':'false')."'";
|
echo " polygon='".($bShowPolygons?'true':'false')."'";
|
||||||
if (sizeof($aExcludePlaceIDs))
|
if (sizeof($aExcludePlaceIDs))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -63,8 +63,7 @@
|
|||||||
$aCoOrdinatesLBRT = explode(',',$aParams['viewboxlbrt']);
|
$aCoOrdinatesLBRT = explode(',',$aParams['viewboxlbrt']);
|
||||||
$oGeocode->setViewBox($aCoOrdinatesLBRT[0], $aCoOrdinatesLBRT[1], $aCoOrdinatesLBRT[2], $aCoOrdinatesLBRT[3]);
|
$oGeocode->setViewBox($aCoOrdinatesLBRT[0], $aCoOrdinatesLBRT[1], $aCoOrdinatesLBRT[2], $aCoOrdinatesLBRT[3]);
|
||||||
}
|
}
|
||||||
|
else if (isset($aParams['viewbox']) && $aParams['viewbox'])
|
||||||
if (isset($aParams['viewbox']) && $aParams['viewbox'])
|
|
||||||
{
|
{
|
||||||
$aCoOrdinatesLTRB = explode(',',$aParams['viewbox']);
|
$aCoOrdinatesLTRB = explode(',',$aParams['viewbox']);
|
||||||
$oGeocode->setViewBox($aCoOrdinatesLTRB[0], $aCoOrdinatesLTRB[3], $aCoOrdinatesLTRB[2], $aCoOrdinatesLTRB[1]);
|
$oGeocode->setViewBox($aCoOrdinatesLTRB[0], $aCoOrdinatesLTRB[3], $aCoOrdinatesLTRB[2], $aCoOrdinatesLTRB[1]);
|
||||||
@@ -187,12 +186,15 @@
|
|||||||
|
|
||||||
$bAsText = $oGeocode->getIncludePolygonAsText();
|
$bAsText = $oGeocode->getIncludePolygonAsText();
|
||||||
$sQuery = $oGeocode->getQueryString();
|
$sQuery = $oGeocode->getQueryString();
|
||||||
|
$sViewBox = $oGeocode->getViewBoxString();
|
||||||
|
$bShowPolygons = (isset($_GET['polygon']) && isset($_GET['polygon']));
|
||||||
|
$aExcludePlaceIDs = $oGeocode->getExcludedPlaceIDs();
|
||||||
|
|
||||||
$sMoreURL = CONST_Website_BaseURL.'search?format='.urlencode($sOutputFormat).'&exclude_place_ids='.join(',',$oGeocode->getExcludedPlaceIDs());
|
$sMoreURL = CONST_Website_BaseURL.'search?format='.urlencode($sOutputFormat).'&exclude_place_ids='.join(',',$oGeocode->getExcludedPlaceIDs());
|
||||||
if (isset($_SERVER["HTTP_ACCEPT_LANGUAGE"])) $sMoreURL .= '&accept-language='.$_SERVER["HTTP_ACCEPT_LANGUAGE"];
|
if (isset($_SERVER["HTTP_ACCEPT_LANGUAGE"])) $sMoreURL .= '&accept-language='.$_SERVER["HTTP_ACCEPT_LANGUAGE"];
|
||||||
if (isset($_GET['polygon']) && isset($_GET['polygon'])) $sMoreURL .= '&polygon=1';
|
if ($bShowPolygons) $sMoreURL .= '&polygon=1';
|
||||||
if ($oGeocode->getIncludeAddressDetails()) $sMoreURL .= '&addressdetails=1';
|
if ($oGeocode->getIncludeAddressDetails()) $sMoreURL .= '&addressdetails=1';
|
||||||
if (isset($_GET['viewbox']) && $_GET['viewbox']) $sMoreURL .= '&viewbox='.urlencode($_GET['viewbox']);
|
if ($sViewBox) $sMoreURL .= '&viewbox='.urlencode($sViewBox);
|
||||||
if (isset($_GET['nearlat']) && isset($_GET['nearlon'])) $sMoreURL .= '&nearlat='.(float)$_GET['nearlat'].'&nearlon='.(float)$_GET['nearlon'];
|
if (isset($_GET['nearlat']) && isset($_GET['nearlon'])) $sMoreURL .= '&nearlat='.(float)$_GET['nearlat'].'&nearlon='.(float)$_GET['nearlon'];
|
||||||
$sMoreURL .= '&q='.urlencode($sQuery);
|
$sMoreURL .= '&q='.urlencode($sQuery);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user