示例#1
0
 /**
  * 
  * This method will append Geolocation attributes to Attributes Array
  *
  * @param type $lat
  * @param type $lng
  * @return \Orion\Operations\updateContext
  */
 public function addGeolocation($lat, $lng)
 {
     $geometadata = new \Orion\Context\ContextFactory();
     $geometadata->put("name", "location");
     $geometadata->put("type", "string");
     $geometadata->put("value", "WSG84");
     $metadata = array($geometadata->getContext());
     $value = $lat . ", " . $lng;
     //EX: "40.418889, -23.691944"
     $this->_currentelement->addAttrinbute("position", "coords", $value, $metadata);
     return $this;
 }