Skip to content

Commit 03947af

Browse files
committed
【SDK】【修正】【修正maxResolution参数写错】
【SDK】【修正】【补充代码注释】
1 parent b63af41 commit 03947af

File tree

1 file changed

+57
-5
lines changed

1 file changed

+57
-5
lines changed

src/openlayers/layer/3rdLayer.js

Lines changed: 57 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -695,9 +695,60 @@ Zondy.Source.TiandituMapSource = TiandituMapSource;
695695
* 显示天地图的功能服务
696696
* @class Zondy.Map.TianDiTu
697697
* @classdesc 显示天地图的功能服务构造函数
698-
*
699-
* @param {Object} option 属性键值对
700-
* @param {Zondy.Source.TiandituMapSource} [option.source = null] openlayer的地图source
698+
* @description Zondy.Map.TianDiTu
699+
* @param option - {Object} 必选项,设置其他属性键值对对象。对象中的属性来自本类的属性。例如:{key1:value1, key2:value2 …}
700+
* @param {String} [option.token = ''] 必选项,天地图token,一定要去天地图网站申请。
701+
* @param {String} [option.layerType = ''] 必选项,图层类型。类型有:vec(天地图矢量数据);img(
702+
天地图影像数据);cva(天地图矢量注记数据);cia(天地图影像注记数据);vec_igs(天地图矢量数据(通过IGS));
703+
img_igs(天地图影像数据(通过IGS));cva_igs(天地图矢量注记数据(通过IGS));cia_igs(天地图影像注记数据(通过IGS))
704+
* @param {Number[]} [option.extent = ''] 可选项,图层范围,如:[-180, -90, 180, 90]。
705+
* @param {Number[]} [option.origin = ''] 可选项,地图原点。默认左下角。
706+
* @param {Number} [option.minZoom = ''] 可选项,瓦片最小级数。
707+
* @param {Number} [option.maxZoom = ''] 可选项,瓦片最大级数。
708+
* @param {Number} [option.tileSize = ''] 可选项,地图图片大小。
709+
* @param {Number} [option.noWrap = ''] 可选项,地图是否连续显示。
710+
* @example
711+
var map;
712+
var tiandituLayer;
713+
//地图初始化函数
714+
function init() {
715+
map = new ol.Map({
716+
target: 'mapCon',
717+
view: new ol.View({
718+
projection: ol.proj.get('EPSG:4326'),
719+
center: [110, 30],
720+
maxZoom: 14,
721+
minZoom: 1,
722+
zoom: 4
723+
})
724+
});
725+
tiandituLayer = new Zondy.Map.TianDiTu({
726+
//图层类型
727+
layerType: 'vec',
728+
//最小显示等级
729+
minZoom: 0,
730+
//最大显示等级
731+
maxZoom: 15,
732+
//key
733+
token: "4c27d6e0e8a90715b23a989d42272fd8",
734+
//设置地图不连续显示
735+
noWrap: true
736+
});
737+
map.addLayer(tiandituLayer
738+
var tiandituLayer2 = new Zondy.Map.TianDiTu({
739+
//图层类型
740+
layerType: 'cva',
741+
//最小显示等级
742+
minZoom: 0,
743+
//最大显示等级
744+
maxZoom: 15,
745+
//key
746+
token: "4c27d6e0e8a90715b23a989d42272fd8",
747+
//设置地图不连续显示
748+
noWrap: true
749+
});
750+
map.addLayer(tiandituLayer2);
751+
}
701752
*/
702753
var TianDiTu = function (option) {
703754
var options = option !== undefined ? option : {};
@@ -1369,10 +1420,11 @@ var OpenStreetMapSource = function (option) {
13691420
* @type {Number}
13701421
* @description 最大分辨率,新瓦片必须指定
13711422
* @default null
1372-
*/xResolution = null;
1423+
*/
1424+
this.maxResolution = null;
13731425

13741426
//根据投影获取地图范围
1375-
var tileProjection = options.projection !== undefined ? options.projection : ol_proj.get('EPSG:3857');
1427+
var tileProjection = options.projection !== undefined ? options.projxResolutionection : ol_proj.get('EPSG:3857');
13761428

13771429
/**
13781430
* @member Zondy.Source.OpenStreetMapSource.prototype.tileExtent

0 commit comments

Comments
 (0)