PHP code example of elektromann / yii2-openlayers-maps

1. Go to this page and download the library: Download elektromann/yii2-openlayers-maps 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/ */

    

elektromann / yii2-openlayers-maps example snippets


<?= \elektromann\openlayers\Map::widget(); 

<?= \elektromann\openlayers\Map::widget([
    'center' => [-0.1276474, 51.5073219], //London
]); 

<?= \elektromann\openlayers\Map::widget([
    'center' => "London",
]); 

<?= \elektromann\openlayers\Map::widget([
    'center' => "London",
]); 

<?= \elektromann\openlayers\Map::widget([
    'center' => [-0.1276474, 51.5073219],
    'markers' => [
        [], //Marker in the map center
        [
            'center' => "London, Bond street", //Set marker position
            'title' => "Bond street here", //Title of the marker
            'description' => "You can see Bond street", //Show wher one click on marker
        ],
    ]
]); 

php composer.phar