<?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;
|
|
}
|
|
}
|