1. Go to this page and download the library: Download webmapp/wm-osmfeatures library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
webmapp / wm-osmfeatures example snippets
use Wm\WmOsmfeatures\Interfaces\OsmfeaturesSyncableInterface;
use Wm\WmOsmfeatures\Traits\OsmfeaturesSyncableTrait;
class Municipality extends Model implements OsmfeaturesSyncableInterface
{
use OsmfeaturesSyncableTrait;
// Your model implementation
}
class Municipality extends Model implements OsmfeaturesSyncableInterface
{
// ...
public static function getOsmfeaturesEndpoint(): string
{
return 'https://osmfeatures.maphub.it/api/v1/features/admin-areas/';
}
public static function getOsmfeaturesListQueryParameters(): array
{
return ['admin_level' => 8];
}
public static function osmfeaturesUpdateLocalAfterSync(string $osmfeaturesId): void
{
// Your implementation
}
// ...
}
use Wm\WmOsmfeatures\Traits\OsmfeaturesImportableTrait;
use Wm/WmOsmfeatures\Interfaces\OsmfeaturesSyncableInterface;
class Municipality extends Model implements OsmfeaturesSyncableInterface
{
use OsmfeaturesImportableTrait;
//...
}