PHP code example of meysampg / yii2-gmapmarker

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

    

meysampg / yii2-gmapmarker example snippets


return [
    // Some codes are here :)
   	'components' => [
   		// And also maybe here ;)
     	'assetManager' => [
     		'bundles' => [
     			'meysampg\gmap\GMapAsset' => [
     				'key' => 'YOU_API_KEY',
     				'language' => 'en'
     			],
     		],
  		],
    ],
];

<?= GMapMarker::widget([
	'width' => '98', // Using pure number for 98% of width.
	'height' => '400px', // Or use number with unit (In this case 400px for height).
    'marks' => [35.6892, 51.3890],
    'zoom' => 5,
    'disableDefaultUI' => true
]); 

<?= GMapMarker::widget([
	'width' => '600px',
	'height' => '400px',
    'marks' => [
        [35.6892, 51.3890],
        [31.3183, 48.6706],
        [29.4850, 57.6439]
    ],
    'zoom' => 5,
    'disableDefaultUI' => true
]);