diff --git a/src/views/modules/visual/cpts/map/index.vue b/src/views/modules/visual/cpts/map/index.vue
index acd84557f..29c390945 100644
--- a/src/views/modules/visual/cpts/map/index.vue
+++ b/src/views/modules/visual/cpts/map/index.vue
@@ -17,8 +17,14 @@ import { requestPost } from "@/js/dai/request";
import cptCard from "@/views/modules/visual/cpts/card";
import cptTb from "@/views/modules/visual/cpts/tb";
import nextTick from "dai-js/tools/nextTick";
-import { Scene, PolygonLayer, LineLayer, PointLayer } from "@antv/l7";
-import { GaodeMap, Map } from "@antv/l7-maps";
+import {
+ Scene,
+ RasterLayer,
+ PolygonLayer,
+ LineLayer,
+ PointLayer,
+} from "@antv/l7";
+import { GaodeMap, Map, Mapbox } from "@antv/l7-maps";
import { spliceIntoChunks } from "@/utils/index";
let scene;
@@ -240,7 +246,6 @@ export default {
};
},
-
dotData2() {
const { dotList2 } = this;
return {
@@ -296,9 +301,26 @@ export default {
scene = new Scene({
id: "map",
logoVisible: false,
- map: new GaodeMap({
- pitch: this.pitch,
- style: styleConfig.style,
+ // map: new GaodeMap({
+ // pitch: this.pitch,
+ // style: styleConfig.style,
+ // center: [
+ // srcGridData.longitude ||
+ // this.$store.state.user.longitude ||
+ // 116.39743841556731,
+ // srcGridData.latitude ||
+ // this.$store.state.user.latitude ||
+ // 39.9088810666821,
+ // ],
+ // token: "fc14b42e0ca18387866d68ebd4f150c1",
+ // zoom: 18,
+ // isHotspot: false,
+ // resizeEnable: true,
+ // doubleClickZoom: false,
+ // }),
+
+ map: new Mapbox({
+ style: "blank",
center: [
srcGridData.longitude ||
this.$store.state.user.longitude ||
@@ -307,15 +329,12 @@ export default {
this.$store.state.user.latitude ||
39.9088810666821,
],
- token: "fc14b42e0ca18387866d68ebd4f150c1",
zoom: 18,
- isHotspot: false,
- resizeEnable: true,
- doubleClickZoom: false,
}),
});
scene.on("loaded", async () => {
+ this.iniBaseMap(scene);
this.iniMapGrid(scene);
this.iniMapDot(scene);
this.iniMapDot2(scene);
@@ -324,6 +343,45 @@ export default {
});
},
+ iniBaseMap(scene) {
+ // 底图服务
+ const baseLayer = new RasterLayer({
+ // zIndex: 0,
+ });
+ baseLayer.source(
+ "http://t4.tianditu.com/DataServer?T=vec_w&tk=8a08c117ab9ee45d508686b01cc8d397&x={x}&y={y}&l={z}",
+ {
+ parser: {
+ type: "rasterTile",
+ tileSize: 256,
+ // minZoom: 6,
+ // maxZoom: 15,
+ zoomOffset: 0,
+ },
+ }
+ );
+
+ // 注记服务
+ const annotionLayer = new RasterLayer({
+ // zIndex: 1,
+ });
+ annotionLayer.source(
+ "http://t4.tianditu.com/DataServer?T=cva_w&tk=8a08c117ab9ee45d508686b01cc8d397&x={x}&y={y}&l={z}",
+ {
+ parser: {
+ type: "rasterTile",
+ tileSize: 256,
+ // minZoom: 6,
+ // maxZoom: 15,
+ zoomOffset: 0,
+ },
+ }
+ );
+
+ scene.addLayer(baseLayer);
+ scene.addLayer(annotionLayer);
+ },
+
iniMapGrid(scene) {
const { darkStyle, lightStyle, polygonData, polygonDotData } = this;
@@ -560,7 +618,7 @@ export default {
},
updateGrid() {
- const { polygonData,polygonDotData } = this;
+ const { polygonData, polygonDotData } = this;
if (polygonLayer) {
polygonLayer.setData(polygonData);
lineLayer.setData(polygonData);
diff --git a/src/views/modules/visual/cpts/map/index备份.vue b/src/views/modules/visual/cpts/map/index备份.vue
new file mode 100644
index 000000000..af3c8678a
--- /dev/null
+++ b/src/views/modules/visual/cpts/map/index备份.vue
@@ -0,0 +1,617 @@
+
+
+
+
+ 切换深色模式
+
+
切换浅色模式
+
+
+
+
+
+