*/
protected $routes;
+ /**
+ * A list of tracks.
+ *
+ * @var TypedDoublyLinkedList (Track)
+ */
+ protected $tracks;
+
+ /**
+ * A list of XML snippets describing unsupported elements.
+ *
+ * @var TypedDoublyLinkedList (string)
+ */
+ protected $extensions;
+
/**
* Fetch the name of the program that created the GPX file.
*
return $this->routes;
}
+ /**
+ * Fetch a list of tracks.
+ *
+ * @param boolean $create Create the list if it does not already exist.
+ * @return TypedDoublyLinkedList A list of tracks.
+ */
+ public function getTracks(bool $create = true)
+ {
+ if ($create && $this->tracks === null)
+ $this->tracks = new TypedDoublyLinkedList('libgpx\Track');
+ return $this->tracks;
+ }
+
+ /**
+ * Fetch a list of protocol extensions as raw XML.
+ *
+ * @param boolean $create Create the list if it does not already exist.
+ * @return TypedDoublyLinkedList A list of protocol extensions.
+ */
+ public function getExtensions(bool $create = true)
+ {
+ if ($create && $this->extensions === null)
+ $this->extensions = new TypedDoublyLinkedList('string');
+ return $this->extensions;
+ }
+
/**
* Fetch a bounding box that covers the feature.
*
$result = null;
$lists = [
$this->waypoints,
- $this->routes
+ $this->routes,
+ $this->tracks
];
foreach ($lists as $list) {
if ($list === null) continue;