|
@@ -30,15 +30,16 @@ async function returnProxyUrl(url){
|
|
let arr = url.split('/');
|
|
let arr = url.split('/');
|
|
let username = '';
|
|
let username = '';
|
|
let password = '';
|
|
let password = '';
|
|
|
|
+ debugger
|
|
if(arr.indexOf('MapProxyApi') !== -1){ //不需要授权服务
|
|
if(arr.indexOf('MapProxyApi') !== -1){ //不需要授权服务
|
|
for(let i=0;i<arr.length;i++){
|
|
for(let i=0;i<arr.length;i++){
|
|
if(arr[i] ==='getSceneServer'){
|
|
if(arr[i] ==='getSceneServer'){
|
|
username = arr[i+1];
|
|
username = arr[i+1];
|
|
password = arr[i+2];
|
|
password = arr[i+2];
|
|
const response = await getServiceToken(username,password);
|
|
const response = await getServiceToken(username,password);
|
|
- if(response.length > 0){
|
|
|
|
|
|
+ if(response?.data.length > 0){
|
|
arr.splice(i-1, 4);
|
|
arr.splice(i-1, 4);
|
|
- return arr.join('/')+'/MapServiceProxy/'+response;
|
|
|
|
|
|
+ return arr.join('/')+'/MapServiceProxy/'+response.data;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -47,6 +48,13 @@ async function returnProxyUrl(url){
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+export function SetBackground(){
|
|
|
|
+ invokeParams('SetBackground', {
|
|
|
|
+ "opacity": 1,
|
|
|
|
+ "color": "transparent",
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
//点查询
|
|
//点查询
|
|
export function MapClickByType(status){
|
|
export function MapClickByType(status){
|
|
invokeParams('MapClickAll', {
|
|
invokeParams('MapClickAll', {
|
|
@@ -55,6 +63,49 @@ export function MapClickByType(status){
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+export async function AddBaseMapLayer() {
|
|
|
|
+ let url = await returnProxyUrl("https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/93493321");
|
|
|
|
+ console.log("1111",url);
|
|
|
|
+ debugger
|
|
|
|
+ invokeParams('AddBaseMapLayer', {
|
|
|
|
+ "id": "BaseMap",
|
|
|
|
+ "title": "BaseMap",
|
|
|
|
+ "visible": true,
|
|
|
|
+ "opacity": 1,
|
|
|
|
+ url
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+export async function AddZhenwuMapLayer() {
|
|
|
|
+ let url = await returnProxyUrl("https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/37072265");
|
|
|
|
+ console.log("1111",url);
|
|
|
|
+ debugger
|
|
|
|
+ invokeParams('AddBaseMapLayer', {
|
|
|
|
+ "id": "BaseMapZhenwu",
|
|
|
|
+ "title": "BaseMapZhenwu",
|
|
|
|
+ "visible": true,
|
|
|
|
+ "opacity": 1,
|
|
|
|
+ url
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+export async function AddYaoganMapLayer() {
|
|
|
|
+ let url = await returnProxyUrl("https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/50115036");
|
|
|
|
+ console.log("1111",url);
|
|
|
|
+ debugger
|
|
|
|
+ invokeParams('AddBaseMapLayer', {
|
|
|
|
+ "id": "BaseMapYaoGan",
|
|
|
|
+ "title": "BaseMapYaoGan",
|
|
|
|
+ "visible": true,
|
|
|
|
+ "opacity": 1,
|
|
|
|
+ "type": "tile",
|
|
|
|
+ url
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
export function AddSingleLayer(params){
|
|
export function AddSingleLayer(params){
|
|
if(params.token){
|
|
if(params.token){
|
|
params.url = "https://cimweb.zjw.sh.cegn.cn:2008/MapServiceProxy/" + params.token;
|
|
params.url = "https://cimweb.zjw.sh.cegn.cn:2008/MapServiceProxy/" + params.token;
|