This commit is contained in:
stubbfel
2013-06-27 10:55:07 +02:00
parent c03db748bc
commit 98b83dbfe3
15 changed files with 78 additions and 43 deletions

View File

@@ -21,7 +21,7 @@ class SpsApi extends Api {
public static $routeParameterAlias = "/alias/:alias";
/**
* Route string for the alias paramter
* Route string for the domain paramter
* @var string
*/
public static $routeParameterDomain = "/domain/:domain";
@@ -116,7 +116,6 @@ class SpsApi extends Api {
public function __construct() {
$this->sqlManager = new \database\SpsSqlManager();
parent::__construct();
$this->contentType("Content-type: application/xml;charset=utf-8");
}
/**
@@ -142,6 +141,8 @@ class SpsApi extends Api {
* @return querry result as xml
*/
public function sendSpsCoordinateQuery($queryArgs) {
// check arguments of the query
if (!array_key_exists(SpsApi::$keyLong, $queryArgs) || !array_key_exists(SpsApi::$keyLat, $queryArgs)) {
return null;
}
@@ -152,7 +153,10 @@ class SpsApi extends Api {
return null;
}
// build a request polygon
$queryArgs[SpsApi::$keyPoly] = $this->createPolygon($latitude, $longitude, $this->range);
// send querry
$result = $this->sqlManager->sendSpsCoordinateQuery($queryArgs);
return \utiliy\XmlManager::arrayToSpsXml($result);
}