PHP code example of sdksio / google-maps-platform-sdk

1. Go to this page and download the library: Download sdksio/google-maps-platform-sdk 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/ */

    

sdksio / google-maps-platform-sdk example snippets


use GoogleMapsPlatformLib\Logging\LoggingConfigurationBuilder;
use GoogleMapsPlatformLib\Logging\RequestLoggingConfigurationBuilder;
use GoogleMapsPlatformLib\Logging\ResponseLoggingConfigurationBuilder;
use Psr\Log\LogLevel;
use GoogleMapsPlatformLib\Environment;
use GoogleMapsPlatformLib\Authentication\CustomQueryAuthenticationCredentialsBuilder;
use GoogleMapsPlatformLib\GoogleMapsPlatformClientBuilder;

$client = GoogleMapsPlatformClientBuilder::init()
    ->customQueryAuthenticationCredentials(
        CustomQueryAuthenticationCredentialsBuilder::init(
            'key'
        )
    )
    ->environment(Environment::PRODUCTION)
    ->loggingConfiguration(
        LoggingConfigurationBuilder::init()
            ->level(LogLevel::INFO)
            ->requestConfiguration(RequestLoggingConfigurationBuilder::init()->body(true))
            ->responseConfiguration(ResponseLoggingConfigurationBuilder::init()->headers(true))
    )
    ->build();