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
449 B

<?php
namespace OSM;
use OSM\Element\Element;
class OSM {
public array $elements = [];
public static function createFromJson($json) {
$array = json_decode($json, true);
$instance = new self();
$items = $array['elements'];
foreach ($items as $item) {
$element = Element::createFromArray($item);
$instance->elements[] = $element;
}
return $instance;
}
}