|
@@ -16,6 +16,7 @@ import parse from "wellknown";
|
|
|
import Map from "ol/Map";
|
|
|
import View from "ol/View";
|
|
|
import TileLayer from "ol/layer/Tile";
|
|
|
+import TileWMS from "ol/source/TileWMS";
|
|
|
import VectorSource from "ol/source/Vector";
|
|
|
import VectorLayer from "ol/layer/Vector";
|
|
|
import Feature from "ol/Feature";
|
|
@@ -34,6 +35,7 @@ import ImageLayer from "ol/layer/Image";
|
|
|
import ImageStatic from "ol/source/ImageStatic";
|
|
|
import Draw from "ol/interaction/Draw";
|
|
|
import GeoJSON from "ol/format/GeoJSON";
|
|
|
+import { WMTS } from "ol/source";
|
|
|
export default {
|
|
|
props: {
|
|
|
maptype: {
|
|
@@ -62,10 +64,6 @@ export default {
|
|
|
zoom: 4,
|
|
|
minZoom: 1,
|
|
|
});
|
|
|
- // window.map = this.map;
|
|
|
- // window.view = this.map.view;
|
|
|
- console.log(this.$props.maptype, "----");
|
|
|
- // if (this.$props.maptype == "normal") {
|
|
|
this.addMap("mapDiv", view);
|
|
|
// } else {
|
|
|
this.addMap("mapCon1", view);
|
|
@@ -76,9 +74,15 @@ export default {
|
|
|
if (this.maps[target]) return;
|
|
|
var gaodeMapLayer = new TileLayer({
|
|
|
title: "高德地图",
|
|
|
+ // source: new XYZ({
|
|
|
+ // url: "http://wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=7&x={x}&y={y}&z={z}",
|
|
|
+ // wrapX: false,
|
|
|
+ // }),
|
|
|
source: new XYZ({
|
|
|
- url: "http://wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=7&x={x}&y={y}&z={z}",
|
|
|
- wrapX: false,
|
|
|
+ url: `https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}?token=${this.arcgisKey}`,
|
|
|
+ // url: `https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/default028mm/MapServer/tile/4905/{z}/{y}/{x}`,
|
|
|
+ crossOrigin: "anonymous",
|
|
|
+ // attributions: ["ArcGIS", new Date().getFullYear()],
|
|
|
}),
|
|
|
});
|
|
|
let map = new Map({
|