| | |
| | | const BASE_URL = "http://192.168.20.83:8088/MoonServer/"; //å端æ¥å£å°å |
| | | // const BASE_URL = "http://192.168.20.106:9000/MoonServer/"; //å端æ¥å£å°å |
| | | //æ¯å¦ä¸ºç产ç¯å¢ |
| | | var isWeb = location.hostname.indexOf("103.85.165.") > -1; |
| | | //æ¯å¦ä¸ºç产ç¯å¢ |
| | | const webUrl = location.href.indexOf("/web") > -1 ? "/web" : ""; |
| | | |
| | | var webHost = isWeb ? "103.85.165.99" + ":28888" : '192.168.20.83' + ":8888"; |
| | | //é
ç½®æä»¶å°å |
| | | const config = { |
| | | mapMoon: webUrl + "/mapscreen/index.html", |
| | | //æ¤çä½åå§åå è½½å¾ç |
| | | imgUrl: "Workers/image/earth.jpg", |
| | | //licenseè®¸å¯ |
| | | licenseServer: "http://183.162.245.49:18080", |
| | | //SDKè®¸å¯ |
| | | StaticFileBaseUrl: webUrl + "/CIMSDK/", |
| | | |
| | | var isWeb = location.hostname.indexOf("103.85.165.") > -1; |
| | | proxy: "http://" + webHost + "/MoonServer", |
| | | |
| | | BASE_URL: "http://" + webHost + "/MoonServer", |
| | | conditions: [ |
| | | ["=", "<>", "like"], |
| | | [">=", ">", " =", "<=", "<", "<>"], |
| | | [">=", ">", " =", "<=", "<", "<>"], |
| | | ], |
| | | }; |
| | | export default config; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | const BASE_URL = "http://192.168.20.83:8088/MoonServer/"; //å端æ¥å£å°å |
| | | // const BASE_URL = "http://192.168.20.106:9000/MoonServer/"; //å端æ¥å£å°å |
| | | |
| | | |
| | | var isWeb = location.hostname.indexOf("103.85.165.") > -1; |
| | |
| | | //é
ç½®æä»¶å°å |
| | | import config from "./config"; |
| | | import config from "../../../../public/config/config"; |
| | | //æå¡å è½½é
ç½®æä»¶ |
| | | import server from "./server"; |
| | | |
| | |
| | | import * as turf from "@turf/turf"; |
| | | import WKT from "terraformer-wkt-parser"; |
| | | import rightServer from "./rightServer"; |
| | | import config from "./config"; |
| | | import config from "../../../../public/config/config"; |
| | | import CryptoJS from "crypto-js"; |
| | | // import { Store } from "vuex"; |
| | | import store from "@/store"; |
| | |
| | | import { getToken } from "@/utils/auth"; |
| | | //é
ç½®æä»¶å°å |
| | | import config from "./config"; |
| | | import config from "../../../../public/config/config"; |
| | | import { Map, View } from "ol"; //å°å¾,è§å¾ |
| | | import OSM from "ol/source/OSM"; //å¯ä»¥çè§£ä¸ºæ°æ®æº,å°±æ¯ä¸å¼ å¾ç |
| | | import TileLayer from "ol/layer/Tile"; //å¯ä»¥ç解为å¾å± |
| | |
| | | import WMTSTileGrid from "ol/tilegrid/WMTS.js"; |
| | | import { get as getProjection, Projection } from "ol/proj.js"; |
| | | import { register } from "ol/proj/proj4"; |
| | | |
| | | import MousePosition from "ol/control/MousePosition.js"; |
| | | import { getTopLeft, getWidth } from "ol/extent.js"; |
| | | import { format } from "ol/coordinate"; |
| | | import store from "@/store"; |
| | | const olMap = { |
| | | map: null, |
| | | Layer: null, |
| | | projectionObj: { |
| | | code: "ESRI:103881", |
| | | extent: [-180, -90, 180, 90], |
| | | code: null, |
| | | extent: null, |
| | | }, |
| | | initMap() { |
| | | //googleå°å¾ |
| | |
| | | // "+proj=laea +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +R=1737400 +units=m +no_defs +type=crs" |
| | | // ); |
| | | // register(proj4); |
| | | let mousePositionControl = new MousePosition({ |
| | | coordinateFormat: (coordinate) => { |
| | | store.state.olLon = coordinate[0].toFixed(6) |
| | | store.state.olLat = coordinate[1].toFixed(6); |
| | | if (this.map) { |
| | | store.state.olZoom = parseInt(this.map.getView().getZoom()) |
| | | } |
| | | }, |
| | | projection: this.projectionObj.code, |
| | | target: 'mouse', |
| | | }); |
| | | const projection = new Projection({ |
| | | // code: this.projectionObj.code, |
| | | code: "ESRI:103881", |
| | | extent: [-180, -90, 180, 90], |
| | | code: this.projectionObj.code, |
| | | extent: this.projectionObj.extent, |
| | | // extent: this.projectionObj.extent, |
| | | }); |
| | | this.map = new Map({ |
| | |
| | | layers: [], //AMapLayer, baiduMapLayer |
| | | view: new View({ |
| | | projection: projection, |
| | | center: [180, 90], |
| | | center: [0, 0], |
| | | zoom: 4, |
| | | }), |
| | | controls: [mousePositionControl] |
| | | }); |
| | | }, |
| | | addTreeData(treeNode, obj) { |
| | | // this.delLayerAll(); |
| | | this.projectionObj = obj; |
| | | console.log(this.projectionObj); |
| | | //夿æ¯å¦ä¸ºä»£ç |
| | | if (treeNode.proxy) { |
| | | this.addProxyAddress(treeNode); //æä»£ç |
| | |
| | | code: this.projectionObj.code, |
| | | // extent: this.projectionObj.extent, |
| | | // code: "ESRI:103879", |
| | | extent: [-180, -90, 180, 90], |
| | | extent: this.projectionObj.extent, |
| | | }); |
| | | |
| | | if (this.map) { |
| | | this.map.values_.view.projection_ = projection |
| | | } |
| | | |
| | | // var projection = getProjection("ESRI:103880"); |
| | | var projectionExtent = projection.getExtent(); |
| | | |
| | |
| | | }); |
| | | if (this.map) { |
| | | this.map.addLayer(this.Layer); |
| | | var that = this; |
| | | window.olMap = this.map; |
| | | window.layer = this.Layer |
| | | setTimeout(() => { |
| | | that.getLayersExtent(); |
| | | }, 1000) |
| | | // this.Layer.getSource().on('addfeature', function () { |
| | | // this.map.getView().fit(this.Layer.getSource().getExtent()); |
| | | // }); |
| | | |
| | | this.map.getView().fit(this.projectionObj.extent); |
| | | |
| | | } |
| | | }, |
| | | getLayersExtent() { |
| | | // 缩æ¾è³å¾å±èå´ |
| | | |
| | | this.map.getView().fit(this.Layer.renderer_.renderedExtent_); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | }; |
| | | export default olMap; |
| | |
| | | import { getToken } from "@/utils/auth"; |
| | | //é
ç½®æä»¶å°å |
| | | import config from "./config"; |
| | | import config from "../../../../public/config/config"; |
| | | |
| | | const rightServer = { |
| | | layerList: [], |
| | |
| | | import { getToken } from "@/utils/auth"; |
| | | //é
ç½®æä»¶å°å |
| | | import config from "./config"; |
| | | import config from "../../../../public/config/config"; |
| | | import store from "@/store"; |
| | | const server = { |
| | | layerList: [], |
| | |
| | | spatialTitle: null, |
| | | setExportList: false, |
| | | setLayerManager: false, |
| | | olLon: "0.00", |
| | | olLat: "0.00", |
| | | olZoom: 0, |
| | | }, |
| | | mutations: { |
| | | //è·åç»å½Code |
| | |
| | | import router from "@/router/index"; |
| | | |
| | | import { getToken } from "@/utils/auth"; |
| | | import config from "../assets/js/Map/config"; |
| | | import config from "../../public/config/config"; |
| | | // create an axios instance |
| | | const service = axios.create({ |
| | | baseURL: config.BASE_URL, // apiçbase_url |
| | |
| | | <div |
| | | id="mapView" |
| | | class="mapView" |
| | | ></div> |
| | | > |
| | | |
| | | <div class="coordinate">ç»åº¦ï¼{{store.state.olLon}} 纬度ï¼{{store.state.olLat }} 级å«ï¼{{store.state.olZoom }} </div> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts" setup> |
| | | import { useStore } from "vuex"; // å¼å
¥useStore æ¹æ³ |
| | | const store = useStore(); // è¯¥æ¹æ³ç¨äºè¿åstore å®ä¾ |
| | | import olMap from "@/assets/js/Map/olMap"; |
| | | import { |
| | | ref, |
| | |
| | | margin: 0; |
| | | padding: 0; |
| | | position: absolute; |
| | | .coordinate { |
| | | bottom: 1%; |
| | | left: 1%; |
| | | padding: 10px; |
| | | background: rgba(7, 8, 14, 0.8); |
| | | z-index: 30; |
| | | box-shadow: inset 0px 2px 10px 2px rgba(38, 47, 71, 1); |
| | | position: absolute; |
| | | font-size: 16px; |
| | | font-family: Source Han Sans CN; |
| | | font-weight: 400; |
| | | color: #ffffff; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | nextTick, |
| | | watch, |
| | | } from "vue"; |
| | | import config from "@/assets/js/Map/config"; |
| | | import config from "../../../public/config/config.js"; |
| | | import { User, Lock, Plus, Location } from "@element-plus/icons-vue"; |
| | | import { dataQuery_selectByPage, dataQuery_selectFields } from "@/api/api"; |
| | | import { ElMessage } from "element-plus"; |
| | |
| | | defineProps, |
| | | defineEmits, |
| | | } from "vue"; |
| | | import config from "@/assets/js/Map/config"; |
| | | import config from "../../public/config/config.js"; |
| | | //Router |
| | | import router from "@/router"; |
| | | //徿 |
| | |
| | | nextTick, |
| | | } from "vue"; |
| | | import menuTool from "@/assets/js/Map/menuTool"; |
| | | import config from "@/assets/js/Map/config"; |
| | | import config from "../../../public/config/config.js"; |
| | | import { User, Lock, Plus, Refresh, Location } from "@element-plus/icons-vue"; |
| | | import { |
| | | dataQuery_selectByPage, |
| | |
| | | ArrowRight, |
| | | DArrowRight, |
| | | } from "@element-plus/icons-vue"; |
| | | import config from "@/assets/js/Map/config"; |
| | | import config from "../../../public/config/config.js"; |
| | | import { dataQuery_selectByPage } from "@/api/api.js"; |
| | | import { ElMessage } from "element-plus"; |
| | | let searchValue = ref(""); |