Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Latest commit cdfb89c Feb 28, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
resources/views first commit Feb 27, 2019
src Update TencentMap.php Feb 28, 2019
.gitignore
LICENSE first commit Feb 27, 2019
README.md
composer.json

README.md

Tencent Map with search for Laravel-admin

这个扩展用来帮助你在 form 表单中通过使用腾讯地图搜索地址和点击地图来获取经纬度。

截图

搜索地址

安装

composer require jxlwqq/tencent-map

配置

打开config/admin.php,按照你的情况在extensions部分加上如下的配置:

    'extensions' => [
        'tencent-map' => [
            'enable' => true,
            'api_key' => env('TENCENT_MAP_API_KEY')
        ]
    ]

使用

假设你的表中有两个字段latitudelongitude分别表示纬度和经度,那么在表单中使用如下:

$form->tencentMap('latitude', 'longitude', '经纬度');

// 设置地图高度
$form->tencentMap('latitude', 'longitude', '经纬度')->height(500);

// 设置地图缩放
$form->tencentMap('latitude', 'longitude', '经纬度')->zoom(13);

// 设置默认值
$form->tencentMap('latitude', 'longitude', '经纬度')->default(['lat' => 90, 'lng' => 90]);

License

Licensed under The MIT License (MIT).

You can’t perform that action at this time.