PHP code example of antto1 / laravel-admin-ext-latlong
1. Go to this page and download the library: Download antto1/laravel-admin-ext-latlong 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/ */
antto1 / laravel-admin-ext-latlong example snippets
'extensions' => [
'latlong' => [
// Whether to enable this extension, defaults to true
'enable' => true,
// Specify the default provider
'default' => 'baidu',
// According to the selected provider above, fill in the corresponding api_key
'providers' => [
'google' => [
'api_key' => '',
],
'yandex' => [
'api_key' => '',
],
'baidu' => [
'api_key' => '',
],
'tencent' => [
'api_key' => '',
],
'amap' => [
'api_key' => '',
],
]
]
]
$form->latlong('latitude', 'longitude', 'Position');
// Set the map height
$form->latlong('latitude', 'longitude', 'Position')->height(500);
// Set the map zoom
$form->latlong('latitude', 'longitude', 'Position')->zoom(16);
// Set default position
$form->latlong('latitude', 'longitude', 'Position')->default(['lat' => 90, 'lng' => 90]);