2 Star 0 Fork 0

积木云插件/开发示例

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
FormMapsController.php 2.04 KB
一键复制 编辑 原始数据 按行查看 历史
<?php
/**
* 积木云渲染器
*
* @package XbCode
* @author 楚羽幽 <958416459@qq.com>
* @version 1.0
* @license Apache License 2.0
* @link http://www.xbcode.net
* @document http://doc.xbcode.net
*/
namespace plugin\xbDevExample\app\admin\controller;
use support\Request;
use plugin\xbCode\XbController;
use plugin\xbCode\builder\Builder;
use plugin\xbCode\builder\Renders\Form;
/**
* 地图表单
* @copyright 贵州小白基地网络科技有限公司
* @author 楚羽幽 cy958416459@qq.com
*/
class FormMapsController extends XbController
{
/**
* 列表
* @return \support\Response
* @copyright 贵州小白基地网络科技有限公司
* @author 楚羽幽 cy958416459@qq.com
*/
public function index(Request $request)
{
$builder = Builder::form(function (Form $builder) {
// 设置无包裹框
$builder->useForm()->wrapWithPanel(false);
$builder->addRowDivider('地图组件示例');
$builder->addRowAmapPicker('AmapPicker', '高德地图-位置选择器')->ak('4ba3ba65f14940e699fc219576b9b103');
$builder->addRowAmapPicker('aMapPickerStatic', '高德地图-静态展示')->static(true);
$builder->addRowBmapPicker('bMapPicker', '百度地图-位置选择器')->ak('LiZT5dVbGTsPI91tFGcOlSpe5FDehpf7');
$builder->addRowBmapPicker('bMapPickerStatic', '百度地图-静态展示', [
"address" => "北京市西城区复兴门内大街97号",
"lat" => 39.91404014231763,
"lng" => 116.36857981150743,
"zoom" => 12
])
->ak('LiZT5dVbGTsPI91tFGcOlSpe5FDehpf7')
->staticSchema([
'embed' => true,
'showAddress' => true,
'mapStyle' => [
'height' => '600px',
],
])
->static(true);
});
$builder->setMethod('POST');
return $this->successRes($builder);
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/xbcode-plugin/xbDevExample.git
git@gitee.com:xbcode-plugin/xbDevExample.git
xbcode-plugin
xbDevExample
开发示例
main

搜索帮助