/*
 * @Author: ysh
 * @Date: 2024-06-25 10:11:45
 * @LastEditors: 
 * @LastEditTime: 2024-07-01 13:54:24
 */

import TileLayer from 'ol/layer/Tile';
import { Cluster, Vector as VectorSource, XYZ } from 'ol/source';

const Tianditu = new TileLayer({
  source: new XYZ({
    url: 'http://t4.tianditu.com/DataServer?T=img_w&tk=4d02670f819130ba862ebc24a1aebaf3&x={x}&y={y}&l={z}'
  }),
  properties: {
    name: '天地图'
  },
  visible: false
})

// 中科星图
const ZhongKe = new TileLayer({
  source: new XYZ({
    url: "https://tiles1.geovisearth.com/base/v1/img/{z}/{x}/{y}?format=webp&tmsIds=w&token=9b56a7bcb2f51c939753bc066fa6d0e7b7f55cfbf1939fa9e04f53050f4154b9"
  }),
  properties: {
    name: '中科星图'
  },
  visible: true
})

// ArcGIS
const ArcGISBlue = new TileLayer({
  source: new XYZ({
    url: "https://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{z}/{y}/{x}"
  }),
  properties: {
    name: 'ArcGIS'
  },
  visible: false
})

// 高德
const Autonavi = new TileLayer({
  source: new XYZ({
    url: "https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}"
  }),
  properties: {
    name: '高德'
  },
  visible: false
})
// 谷歌
const google = new TileLayer({
  source: new XYZ({
    url: "https://gac-geo.googlecnapps.cn/maps/vt?lyrs=s,m&gl=CN&x={x}&y={y}&z={z}"
  }),
  properties: {
    name: '谷歌'
  },
  visible: false
})
const terrain = new TileLayer({
  source: new XYZ({
    url: "http://t4.tianditu.com/DataServer?T=ter_c&tk=4d02670f819130ba862ebc24a1aebaf3&x={x}&y={y}&l={z}"
  }),
  properties: {
    name: '天地图地形'
  },
  visible: false
})
const vect = new TileLayer({
  source: new XYZ({
    url: "http://t4.tianditu.com/DataServer?T=vec_w&tk=81b9a9cf3e4be1df181e7bf54c5949fc&x={x}&y={y}&l={z}"
  }),
  properties: {
    name: '矢量图'
  },
  visible: false
})


export { Tianditu, ZhongKe, ArcGISBlue, Autonavi, google, terrain, vect }