1. Go to this page and download the library: Download stadiamaps/api 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/ */
stadiamaps / api example snippets
// Pick one:
//
// Composer:
// use OpenAPI\Client\Configuration;
// use OpenAPI\Client\Api\GeocodingApi;
// use OpenAPI\Client\ApiException;
// use GuzzleHttp;
//
// Manual installation:
// api_key', 'YOUR_API_KEY');
$apiInstance = new GeocodingApi(
new GuzzleHttp\Client(),
$config
);
$text = '1600 Pennsylvania Ave NW'; // The place name (address, venue name, etc.) to search for.
try {
// We're using a PHP 8-style named argument; PHP 7 users will need to add a bunch of null arguments
$result = $apiInstance->autocompleteV2($text, lang: 'en');
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling GeocodingApi->autocomplete: ', $e->getMessage(), PHP_EOL;
}
json
{
"diamaps/stadiamaps-api-php": "3.*"
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.