| | |
| | | import ZTTitem from "@/utils/ztt2.js"; |
| | | import { layers } from "../../../../static/json/layer.js"; |
| | | |
| | | import Tile from "ol/layer/Tile"; |
| | | import XYZ from "ol/source/XYZ"; |
| | | import { get as getProjection, getTransform } from "ol/proj"; |
| | | import { createXYZ } from "ol/tilegrid"; |
| | | // import Tile from "ol/layer/Tile"; |
| | | // import XYZ from "ol/source/XYZ"; |
| | | // import { get as getProjection, getTransform } from "ol/proj"; |
| | | // import { createXYZ } from "ol/tilegrid"; |
| | | |
| | | export default { |
| | | name: "LayerPanel", |
| | |
| | | // }); |
| | | // window.map.addLayer(window.tdglLayer); |
| | | |
| | | var url = |
| | | "https://skyzt.bda.gov.cn/gisserver/tmsserver/chengshiguihua_dikuaibianhao_tms/"; |
| | | var projection = getProjection("EPSG:4326"); |
| | | var tmslayer = new Tile({ |
| | | source: new XYZ({ |
| | | // var url = |
| | | // "https://skyzt.bda.gov.cn/gisserver/tmsserver/chengshiguihua_dikuaibianhao_tms/"; |
| | | |
| | | var tmslayer = new ol.layer.Tile({ |
| | | source: new ol.source.XYZ({ |
| | | projection: projection, |
| | | tileGrid: createXYZ({ |
| | | extent: projection.getExtent(), |
| | | tileGrid: ol.tilegrid.createXYZ({ |
| | | extent: [50.731, -90, 180, 70.0478], |
| | | }), |
| | | tileUrlFunction: function (tileCoord, pixelRatio, proj) { |
| | | // return url + (tileCoord[0] - 1) + '/' + tileCoord[1] + '/' + (Math.pow(2, tileCoord[0] - 1) + tileCoord[2]) + '.jpeg'; |
| | | return ( |
| | | url + |
| | | (tileCoord[0] - 1) + |