dy_web_new_gd/public/EzMapFile/EzMapAPI.js
2024-07-19 22:42:54 +08:00

139 lines
4.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use strict";
/*
|------------------------------------------------------------------------------
| EzMapAPI.js
|
|@author: qianleyi
|@date: 2015-11-27
|@descript: 基础地图初始化配置设置
|------------------------------------------------------------------------------
*/
//需要配置客户端ezserverclient服务地址
//var serviceUrl='http://172.18.116.167:8089/dist';
var serviceUrl = 'http://map.pgis.sc/EzServerClient8.0.3';
var ezMap = {
/**
* 二维数组:可以插入多个图层对象
* 参数说明:[]表示图层组,数组中[i][0]表示图层名,[i][1]表示图层的URL,[i][2]表示图层的参数设置
* 参数类型Array
* 取值范围:无限制
* 默认值:无
*/
//泸州地图设置
MapSrcURL: [
["SL", "http://map.pgis.sc/PGIS_S_TileMapServer/Maps/SL/EzMap?Service=getImage&Type=RGB&ZoomOffset=0&Col={x}&Row={y}&Zoom={z}&V=0.3&key=", {
crs: '4326',
imageSRC: '../images/shiliang.png'
}],
["YJDT", "http://map.pgis.sc/PGIS_S_TileMapServer/Maps/QSLST/EzMap?Service=getImage&Type=RGB&ZoomOffset=0&Col={x}&Row={y}&Zoom={z}&V=0.3&key=", {
crs: '4326',
imageSRC: '../images/yingxiang.png'
}],
["DJ", "http://map.pgis.sc/PGIS_S_TileMapServer/Maps/DJ/EzMap?Service=getImage&Type=RGB&ZoomOffset=0&Col={x}&Row={y}&Zoom={z}&V=0.3&key=", {
crs: '4326',
imageSRC: '../images/yingxiang.png'
}],
["LZSL", "http://map.pgis.sc/PGIS_S_TileMapServer/Maps/SL/EzMap?Service=getImage&Type=RGB&ZoomOffset=0&Col={x}&Row={y}&Zoom={z}&V=0.3&key=", {
crs: '4326',
imageSRC: '../images/shiliang.png'
}],
["YX", "http://map.pgis.sc/PGIS_S_TileMapServer/Maps/YX/EzMap?Service=getImage&Type=RGB&ZoomOffset=0&Col={x}&Row={y}&Zoom={z}&V=0.3&key=", {
crs: '4326',
imageSRC: '../images/yingxiang.png'
}],
["GDYS", "http://80.2.22.218:9099/sc_map_bg/{z}/{y}/{x}.png", {
crs: '4326',
imageSRC: '../images/yingxiang.png'
}],
],
/**
* 参数说明:设置地图初始化中心位置
* 参数类型Array<Float,Float>
* 取值范围:无限制
* 默认值:无
*/
CenterPoint: [104.75425466, 31.45795226],
//CenterPoint: [112.568,22.364],
/**
* 参数说明:设置全图显示时地图显示范围
* 参数类型:[minx,miny,maxx,maxy]
* 取值范围:无限制
* 默认值:无
*/
MapFullExtent: undefined,
//MapFullExtent: [116.264129,39.590339,116.564129,39.79],
/**
* 参数说明:设置地图初始显示级别
* 参数类型Int
* 取值范围:无限制
* 默认值:无
*/
MapInitLevel: 15,
//MapInitLevel: 12,
/**
* 参数说明:设置地图显示的最大级别
* 参数类型Int
* 取值范围:无限制
* 默认值:无
*/
MapMaxLevel: 20,
/**
* 参数说明:设置地图显示的最小级别
* 参数类型Int
* 取值范围:无限制
* 默认值:无
*/
MapMinLevel: 2,
/**
* 参数说明是否添加地图级别控制条hover样式
* 参数类型Boolean
* 取值范围:无限制
* 默认值:无
*/
isTitleArea: true,
/**
* 参数说明Animation 瓦片是否提前加载
* 参数类型Boolean
* 取值范围:无限制
* 默认值false
*/
loadTilesWhileAnimating: false
};
(function (ezMap) {
var scriptName = "EzMapAPI\\.js";
var keyWord = "key";
//初始化地图
(function (ezMap) {
var isOL = new RegExp("(^|(.*?\\/))(" + scriptName + ")(\\?|$)");
var scripts = document.getElementsByTagName('script');
for (var i = 0, len = scripts.length; i < len; i++) {
var src = scripts[i].getAttribute('src');
if (src) {
var match = src.match(isOL);
if (match) {
var key = src.indexOf(keyWord + "=");
if (key == -1) {
break;
}
var get_par = src.slice(keyWord.length + key + 1);
var nextPar = get_par.indexOf("&");
if (nextPar != -1) {
get_par = get_par.slice(0, nextPar);
}
ezMap.AuthorKey = get_par;
break;
}
}
}
})(ezMap);
})(ezMap);