PHP code example of nicat / static-map

1. Go to this page and download the library: Download nicat/static-map 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/ */

    

nicat / static-map example snippets


'providers' => [
    Nicat\StaticMap\StaticMapServiceProvider::class,
];

'aliases' => [
    'StaticMap' => Nicat\StaticMap\Facade\StaticMap::class,
];

StaticMap::Google('London')

    'width'       => 600, // Width of Map image
    'height'      => 400, // Height of Map Image
    'mapType'     => 'roadmap', // Map type ['roadmap', 'terrain', 'satellite', 'hyrid']
    'imageFormat' => 'png', // gif, png or jpg
    'zoom'        => 14, // Zoom of Map

{!! StaticMap::GoogleWithImg('London', ['markers' => ['center' => 'Westminster London', 'label' => '2'], 'imageType' => 'gif'])

{!! StaticMap::GoogleWithImg('37.6213129,-122.3811441', ['markers' => true]) !!}

{!! StaticMap::GoogleWithLink('37.6213129,-122.3811441', ['markers' => true]) !!}

    'center'  => '37.6213129,-122.3811441', // or 'San Francisco International Airport'
    'label'   => '1', // Label Name of Marker
    'color'   => '0xff0000', //  color of marker   
    'size'    => 'mid', // tiny (Small),small (Medium), mid (Large)

{!! StaticMap::GoogleWithImg('San Francisco International Airport', ['markers' => [
                ['center' => 'San Bruno', 'label' => '2'],
                ['center' => '37.6213129,-122.3711441', 'label' => '1']
            ]
        ]) !!}

{!! StaticMap::GoogleWithImg('37.6213129,-122.3811441', ['with' => 600, 'height' => 500, 'mapType' => 'hybrid']) !!}
bash
php artisan vendor:publish