From 88a401540460085f6f16137b4d4fff7f1fcf0cb0 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Thu, 21 Jul 2022 17:30:40 +0800
Subject: [PATCH] 冲突

---
 src/components/xymap/map.vue |  103 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 103 insertions(+), 0 deletions(-)

diff --git a/src/components/xymap/map.vue b/src/components/xymap/map.vue
new file mode 100644
index 0000000..b0e7fe6
--- /dev/null
+++ b/src/components/xymap/map.vue
@@ -0,0 +1,103 @@
+<!--
+ * @Descripttion:
+ * @version:
+ * @Author: song
+ * @Date: 2021-04-08 15:14:57
+ * @LastEditors: song
+ * @LastEditTime: 2021-04-24 11:59:43
+-->
+<template>
+    <div id="xymap"></div>
+</template>
+
+<script>
+import OLCesium from "olcs/OLCesium.js"
+import "ol/ol.css"
+import OlView from "ol/View.js"
+import XYZ from "ol/source/XYZ"
+import OlLayerTile from "ol/layer/Tile.js"
+import OlMap from "ol/Map.js"
+import {
+    // eslint-disable-next-line no-unused-vars
+    defaults as OlControlDefaults,
+    defaults,
+    // 全屏控件
+    // FullScreen,
+    // 比例尺控件
+    // ScaleLine,
+    // 缩放滚动条控件
+    // eslint-disable-next-line no-unused-vars
+    ZoomSlider,
+    // 鼠标位置控件
+    // eslint-disable-next-line no-unused-vars
+    MousePosition,
+    // -地图属性控件
+    // Attribution,
+    // 鹰眼控件
+    // eslint-disable-next-line no-unused-vars
+    OverviewMap,
+    // 缩放到范围控件
+    // eslint-disable-next-line no-unused-vars
+    ZoomToExtent,
+    // Rotate,
+} from "ol/control.js"
+
+
+export default {
+    name: "Map",
+    data () {
+        return {
+            view: "",
+        }
+    },
+
+    mounted () {
+        const that = this
+        const ol2d = new OlMap({
+            layers: [
+                new OlLayerTile({
+                    zIndex: 5,
+                    title: "cesium切图",
+                    source: new XYZ({
+                        url: "/wp/{z}/{x}/{y}.png", // 注记
+                    }),
+                }),
+            ],
+
+            // 注意地图控件的写法
+            controls: defaults().extend([
+                // new FullScreen(),
+                // new ScaleLine(),
+                // new MousePosition(),
+                // new Rotate(),
+                // new Attribution()
+            ]),
+            target: "xymap",
+            view: new OlView({
+                center: [116.026801, 28.683427],
+                zoom: 16,
+                projection: "EPSG:4326",
+            }),
+        })
+
+        var view = ol2d.getView()
+
+        this.view = view
+
+        ol2d.on("singleclick", (e) => {
+            that.$emit('setXyValue', e.coordinate)
+        })
+    },
+    methods: {
+
+    },
+};
+</script>
+
+<style scoped lang="scss">
+#xymap {
+    position: relative;
+    width: 100%;
+    height: 480px;
+}
+</style>

--
Gitblit v1.9.3