PHP code example of adibenc / mapplic-php

1. Go to this page and download the library: Download adibenc/mapplic-php 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/ */

    

adibenc / mapplic-php example snippets


use Mapplic\Levels;
use Mapplic\Struct;
use Mapplic\Location;
use Mapplic\LocationFull;

$ms = new Struct();

// /*
$id = 1;
$title = "Lot 1";
$description = "Lot 1 Description";
// $x = 1;
// $y = 1;

// , $x, $y
$level = new Levels(0, "level1", "map.svg");
$ms->appendLevel($level);

// preout($ms);
// exit;

$ml = new Location($id, $title, $description);
$mlfull = new LocationFull($id, $title, $description);

$ms->appendLocation($ml);
$ms->appendLocation($ml);
$ms->appendLocation($ml);

$mlfull->setDescription("desc full");
$ms->appendLocations([$mlfull, $mlfull]);

// preson($ms);

composer