You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

25 lines
522 B

<?php
namespace OSM\Element;
use OSM\Point;
class Node extends Element
{
public Point $point;
public function completeFromArray(array $array): static
{
$this->point = Point::createFromArray($array);
return $this;
}
public function asDOMElement(\DOMDocument $document): \DOMElement {
$xml = parent::asDOMElement($document);
$xml->setAttribute('lat', $this->point->latitude);
$xml->setAttribute('lon', $this->point->longitude);
return $xml;
}
}