File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change 11# Tencent Map with search for Laravel-admin
22
33
4+ 这个扩展用来帮助你在 form 表单中通过使用腾讯地图搜索地址和点击地图来获取经纬度。
5+
6+
7+ ## 截图
8+
9+ <img width =" 916 " alt =" 搜索地址 " src =" https://user-images.githubusercontent.com/2421068/53468061-ab4c0400-3a93-11e9-8a41-4c320733af3d.png " >
10+
11+ ## 安装
12+
13+ ``` bash
14+ composer require jxlwqq/tencent-map
15+ ```
16+
17+ ## 配置
18+
19+ 打开config/admin.php,按照你的情况在extensions部分加上如下的配置:
20+
21+ ```
22+ 'extensions' => [
23+ 'tencent-map' => [
24+ 'enable' => true,
25+ 'api_key' => env('TENCENT_MAP_API_KEY')
26+ ]
27+ ]
28+ ```
29+
30+ ## 使用
31+
32+ 假设你的表中有两个字段` latitude ` 和` longitude ` 分别表示纬度和经度,那么在表单中使用如下:
33+
34+ ``` php
35+ $form->tencentMap('latitude', 'longitude', '经纬度选择');
36+
37+ // 设置地图高度
38+ $form->tencentMap('latitude', 'longitude', '经纬度')->height(500);
39+
40+ // 设置默认值
41+ $form->tencentMap('latitude', 'longitude', '经纬度')->default(['lat' => 90, 'lng' => 90]);
42+
43+ ```
44+
45+ ## License
46+
47+ Licensed under [ The MIT License (MIT)] ( LICENSE ) .
You can’t perform that action at this time.
0 commit comments