diff --git a/plugin.xml b/plugin.xml
index 4195b9c..f1d5fd5 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -3,7 +3,7 @@
com.finebi.plugin.tptj.ivan.chart.demo.amap
yes
- 0.0.2
+ 0.0.4
11.0~11.0
2021-08-30
DEMO
@@ -12,6 +12,7 @@
0.0.1: 图表DEMO_EK init
0.0.2: 图表DEMO_EK 数据处理接口
0.0.3: 图表DEMO_EK 页面刷新接口
+ 0.0.4: 图表DEMO_EK 保存配置接口
]]>
6.0~
com.finebi.plugin.tptj.ivan.chart.demo.amap
diff --git a/src/main/resources/com/finebi/plugin/tptj/ivan/chart/demo/amap/js/chart.js b/src/main/resources/com/finebi/plugin/tptj/ivan/chart/demo/amap/js/chart.js
index 814b582..65149fc 100644
--- a/src/main/resources/com/finebi/plugin/tptj/ivan/chart/demo/amap/js/chart.js
+++ b/src/main/resources/com/finebi/plugin/tptj/ivan/chart/demo/amap/js/chart.js
@@ -19,11 +19,22 @@
const mapAttribute = config["chartStyle"]["mapProp"]["value"];
// 地图组件初始化
- const map = new AMap.Map(dom, {
- resizeEnable: true,
- center: [mapAttribute[0], mapAttribute[1]],
- zoom: mapAttribute[2],
- });
+ let map;
+ let customConfig = config.customConfig;
+ if (customConfig != null && JSON.stringify(customConfig).length > 2) {
+ // 读取保存的配置
+ map = new AMap.Map(dom, {
+ resizeEnable: true,
+ center: [customConfig.lng, customConfig.lat],
+ zoom: customConfig.zoom,
+ });
+ } else {
+ map = new AMap.Map(dom, {
+ resizeEnable: true,
+ center: [mapAttribute[0], mapAttribute[1]],
+ zoom: mapAttribute[2],
+ });
+ }
// 地图设置样式
const styleName = "amap://styles/" + mapAttribute[3];
@@ -48,6 +59,13 @@
});
document.querySelector("#amap-demo-click").onclick = function () {
+ let conf = {
+ zoom: map.getZoom(),
+ lng: map.getCenter().lng,
+ lat: map.getCenter().lat,
+ };
+ // 保存配置
+ saveSessionCallback(conf);
extensionCallBack('refresh');
}
}
diff --git a/说明/0.0.3/0.0.3.zip b/说明/0.0.3/0.0.3.zip
index 999f9db..1b251a2 100644
Binary files a/说明/0.0.3/0.0.3.zip and b/说明/0.0.3/0.0.3.zip differ
diff --git a/说明/0.0.3/fine-plugin-com.finebi.plugin.tptj.ivan.chart.demo.amap-0.0.2.zip b/说明/0.0.3/fine-plugin-com.finebi.plugin.tptj.ivan.chart.demo.amap-0.0.3.zip
similarity index 99%
rename from 说明/0.0.3/fine-plugin-com.finebi.plugin.tptj.ivan.chart.demo.amap-0.0.2.zip
rename to 说明/0.0.3/fine-plugin-com.finebi.plugin.tptj.ivan.chart.demo.amap-0.0.3.zip
index e1b2092..187feb4 100644
Binary files a/说明/0.0.3/fine-plugin-com.finebi.plugin.tptj.ivan.chart.demo.amap-0.0.2.zip and b/说明/0.0.3/fine-plugin-com.finebi.plugin.tptj.ivan.chart.demo.amap-0.0.3.zip differ
diff --git a/说明/0.0.4/0.0.4.zip b/说明/0.0.4/0.0.4.zip
new file mode 100644
index 0000000..650bb64
Binary files /dev/null and b/说明/0.0.4/0.0.4.zip differ
diff --git a/说明/0.0.4/fine-plugin-com.finebi.plugin.tptj.ivan.chart.demo.amap-0.0.4.zip b/说明/0.0.4/fine-plugin-com.finebi.plugin.tptj.ivan.chart.demo.amap-0.0.4.zip
new file mode 100644
index 0000000..aca99fb
Binary files /dev/null and b/说明/0.0.4/fine-plugin-com.finebi.plugin.tptj.ivan.chart.demo.amap-0.0.4.zip differ