예제 #1
0
파일: Api.php 프로젝트: edewaele/yapafo
 /**
  * Create and add a new node to the objects collection.
  *
  * @param type $lat
  * @param type $lon
  * @param array $tags
  * @return OSM_Objects_Node
  */
 public function addNewNode($lat = 0, $lon = 0, array $tags = null)
 {
     $node = new OSM_Objects_Node($this->_newIdCounter--, $lat, $lon, $tags);
     $this->_nodes[$node->getId()] = $node;
     return $node;
 }
예제 #2
0
 /**
  * Add a node as a new member in the relation.
  * 
  * @param OSM_Objects_Node $node
  * @param type $role
  * @return OSM_Objects_Relation Fluent interface
  */
 public function addNode(OSM_Objects_Node $node, $role = '')
 {
     $member = new OSM_Objects_Member(OSM_Api::OBJTYPE_NODE, $node->getId(), $role);
     $this->addMember($member);
     return $this;
 }