Skip to content

Commit 4161d11

Browse files
author
潘卓然ParnDeedlit
committed
2 parents ce27c35 + 2bfc9ef commit 4161d11

File tree

654 files changed

+72067
-22234
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

654 files changed

+72067
-22234
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
/src/common/overlay/
1717
/src/common/assets/
1818
/src/config/common/
19+
src/config/opensource/output/
1920

2021
/website/node_modules/
2122
/website/public/docs/other/

src/cesiumjs/layer/ThirdPartyLayer.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ export default class ThirdPartyLayer extends BaseLayer {
2727
const options = Cesium.defaultValue(optionsParam, {});
2828
this._isHistoryImage = Cesium.defaultValue(options.isHistoryImage, false);
2929
this._imageVersion = Cesium.defaultValue(options.imageVersion, '0');
30-
const offset = Cesium.defaultValue(options.Offset, false);
31-
let offsetLabel = '';
32-
if (offset) {
33-
offsetLabel = '&gl=cn';
34-
}
35-
let url = `http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png`;
30+
// const offset = Cesium.defaultValue(options.Offset, false);
31+
// let offsetLabel = '';
32+
// if (offset) {
33+
// offsetLabel = '&gl=cn';
34+
// }
35+
const url = `http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png`;
3636
const osmMap = this.viewer.imageryLayers.addImageryProvider(
3737
new Cesium.UrlTemplateImageryProvider({
3838
url,
@@ -201,7 +201,7 @@ export default class ThirdPartyLayer extends BaseLayer {
201201
if (!Cesium.defined(options.token)) {
202202
Cesium.deprecationWarning('http://www.tianditu.gov.cn', '请到天地图官网自行申请开发token,自带token仅做功能验证随时可能失效');
203203
}
204-
const url = 'http://t0.tianditu.com/DataServer?';
204+
const url = 'http://t0.tianditu.gov.cn./DataServer?';
205205
const row = '_c&X={x}&Y={y}&L={l}';
206206
switch (options.ptype) {
207207
case 'vec':
@@ -253,7 +253,7 @@ export default class ThirdPartyLayer extends BaseLayer {
253253
const options = Cesium.defaultValue(optionsParam, {});
254254
const token = Cesium.defaultValue(options.token, '9c157e9585486c02edf817d2ecbc7752');
255255
if (Cesium.defined(options.ptype)) {
256-
let url = `http://{s}.tianditu.com/{lw}/wmts?service=WMTS&version=1.0.0&request=GetTile&tilematrix={TileMatrix}&layer={layerType}&style={style}&tilerow={TileRow}&tilecol={TileCol}&tilematrixset=w&format=tiles&tk=${token}`;
256+
let url = `http://{s}.tianditu.gov.cn./{lw}/wmts?service=WMTS&version=1.0.0&request=GetTile&tilematrix={TileMatrix}&layer={layerType}&style={style}&tilerow={TileRow}&tilecol={TileCol}&tilematrixset=w&format=tiles&tk=${token}`;
257257
switch (options.ptype) {
258258
case 'img':
259259
url = url.replace('{lw}', 'img_w');

src/cesiumjs/provider/IgsDocProvider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Cesium from "../../../node_modules/cesium/Source/Cesium";
1+
// import Cesium from "../../../node_modules/cesium/Source/Cesium";
22
import { CesiumZondy } from "../core/Base";
33

44
var defaultCreditZondy = new Cesium.Credit("MapGISMap");

src/cesiumjs/provider/IgsTileProvider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Cesium from "../../../node_modules/cesium/Source/Cesium";
1+
// import Cesium from "../../../node_modules/cesium/Source/Cesium";
22
import { CesiumZondy } from "../core/Base";
33

44
var defaultCreditZondy = new Cesium.Credit("MapGISMap");

src/cesiumjs/provider/WmtsTileProvider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Cesium from "../../../node_modules/cesium/Source/Cesium";
1+
// import Cesium from "../../../node_modules/cesium/Source/Cesium";
22
import { CesiumZondy } from "../core/Base";
33

44
var defaultCreditZondy = new Cesium.Credit("MapGISMap");

src/cesiumjs/ui/interact/CesiumSelectionIndicator.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {CesiumZondy} from '../../core/Base';
2-
import Cesium from '../../../../node_modules/cesium/Source/Cesium';
3-
var Cartesian2 = Cesium.Cartesian2;
4-
var DeveloperError = Cesium.DeveloperError;
2+
// import Cesium from '../../../../node_modules/cesium/Source/Cesium';
3+
// var Cartesian2 = Cesium.Cartesian2;
4+
// var DeveloperError = Cesium.DeveloperError;
55
import defined from '../../../../node_modules/cesium/Source/Core/defined';
66
import EasingFunction from '../../../../node_modules/cesium/Source/Core/EasingFunction';
77
import knockout from '../../../../node_modules/cesium/Source/ThirdParty/knockout';

src/leaflet/layer/mapWmtsLayer.js

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,15 @@ import {L} from 'leaflet';
3535
*/
3636
var MapWMTSLayer = window.L.TileLayer.extend({
3737
options: {
38-
yAxis: "down",
39-
origin: [-180, 90],
4038
version: '1.0.0',
41-
style: 'default',
39+
style: '',
4240
serverName: '',//服务名
4341
tilematrixSet: '', //矩阵集名称
4442
layer: '', //图层名
4543
format: 'image/png',
4644
tileSize: 256,
47-
attribution: "Zondy WMTS Data"
45+
attribution: "Zondy WMTS Data",
46+
noWrap: true
4847
},
4948
//var layer3 = new ZondyMapWMTSLayer("http://localhost:6163/igs/rest/ogc/WMTSServer", { tilematrixSet: "EPSG:4326_世界地图经纬度LEVEL7_028mm_GB", layer: 'World_level7_WMTS' }).addTo(mymap);
5049
//
@@ -112,8 +111,10 @@ var MapWMTSLayer = window.L.TileLayer.extend({
112111
// } else {
113112
// yGrid = Math.floor(dy / (tileSize * resolution));
114113
// }
114+
115115
var zoom = this._getZoomForUrl();
116116
var url = window.L.Util.template(this._url, {s: this._getSubdomain(coords)});
117+
117118
var obj = {
118119
version: this.options.version,
119120
style: this.options.style,
@@ -123,13 +124,23 @@ var MapWMTSLayer = window.L.TileLayer.extend({
123124
tilematrix: zoom,
124125
tilerow: coords.y,
125126
tilecol: coords.x
126-
// tilematrix: coords.z,
127-
// tilerow: yGrid,
128-
// tilecol: xGrid
129127
};
128+
129+
//根据地图的不同,拼装不同的url参数
130+
if(url.indexOf('tianditu') > -1){
131+
obj.tilematrixSet = 'c';
132+
}else if(url.indexOf('geoserver') > -1){
133+
obj.tilematrix = this.options.tilematrixSet+ ':'+zoom;
134+
}
135+
130136
if (this.options.token) {
131-
obj.token = this.options.token
137+
if(url.indexOf('tianditu') > -1){
138+
obj.tk = this.options.token
139+
}else {
140+
obj.token = this.options.token
141+
}
132142
}
143+
133144
return url + window.L.Util.getParamString(obj, url);
134145
}
135146
});

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

src/openlayers/layer/mapDocLayer.js

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,48 @@ Zondy.Source.MapDocSource = MapDocSource;
313313
/// <param {string} opt_name 图层名称,无实际意义可为null.</param>
314314
/// <param {string} opt_docName 要显示的地图文档名称.</param>
315315
/// <param name="opt_options" type="Object">属性键值对</param>
316+
/**
317+
* @class Zondy.Map.Doc
318+
* @classdesc Doc显示矢量地图文档,与MapDocTileLayer的区别是Doc方法只会返回一张图片,而MapDocTileLayer会将地图裁成多张返回
319+
* @description Zondy.Map.Doc
320+
* @param opt_name - {String} 可选项,显示瓦片地图的名称,无实际意义,可为NULL。
321+
* @param opt_docName - {String} 必选项,动态裁图的矢量地图文档的名称(IGServer上发布的实际名称)
322+
* @param opt_options - {Object} 必选项,设置其他属性键值对对象。对象中的属性来自本类的属性。例如:{key1:value1, key2:value2 …}
323+
* @param {String} [opt_options.ip = ''] 必选项,服务器ip地址,本地为“127.0.0.1”或“localhost”。
324+
* @param {String} [opt_options.port = '6163'] 必选项,服务器端口号,默认值6163
325+
* @param {String} [opt_options.token = ''] 可选项,服务访问控制,如果在 MapGIS Server Manager 服务管理中开启token,须设置此项,其key值可在设置处获取。
326+
* @param {String} [opt_options.f = 'png'] 可选项,图像类型,取值为:jpg|png|gif,默认值png
327+
* @param {String} [opt_options.layers = ''] 可选项,控制矢量地图文档中图层的显示,显示状态有四种形式:show:表示只显示指定图层;hide:表示隐藏不需要显示的图层;include:表示显示除默认图层(地图文档内图层状态为可见的图层)外,另追加指定图层;exclude:表示从默认图层列表里删除指定图层后进行显示;语法为:“layers=显示状态:图层序号,图层序号...”,如“layers=show:1,2,3”。当不设置此项时,表示显示全部图层。
328+
* @param {String} [opt_options.filters = 'false'] 可选项,图层过滤条件,它由多个键值对组成,值为您所要设定的过滤条件。如:'1:ID>4,3:ID>1”。过滤条件中用到的符号包括“==”、“!=”、“<”、“>”、“<=”、“>=”、“..”、“~”等,当包含中文条件时,请使用UTF-8编码格式,其中“:”和“,”为保留字符,用于表示键值对概念和分隔不同图层的条件,请不要将这2个字符用于自定义条件中,javascitpt中请使用encodeURI()函数编码后再代入filters参数中。
329+
* @param {Zondy.Object.CDisplayStyle} [opt_options.style = ''] 可选项,地图文档显示样式参数
330+
* @param {Zondy.Object.CGetImageBySRSID} [opt_options.proj = ''] 可选项,动态投影参数,设置地图文档在服务器端重新投影所需的空间参考系对象。
331+
* @param {String} [opt_options.guid = ''] 可选项,地图文档缓存的唯一标识,一般无需赋值。
332+
* @example
333+
<script type="text/javascript">
334+
//定义地图文档图层和地图
335+
var mapDocLayer, map;
336+
// 初始化地图显示
337+
function init() {
338+
//初始化地图容器
339+
map = new ol.Map({
340+
target: "mapCon",
341+
view: new ol.View({
342+
center: [(108.34341 + 116.150939561213) / 2, (29.0125822276524 + 33.2932017737021) / 2],
343+
zoom: 6,
344+
projection: "EPSG:4326"
345+
})
346+
});
347+
var { protocol, ip, port } = window.webclient;
348+
//初始化地图文档图层对象
349+
mapDocLayer = new Zondy.Map.Doc("MapGIS IGS MapDocLayer", "Hubei4326", {
350+
ip: `${ip}`,
351+
port: `${port}`
352+
});
353+
//将地图文档图层加载到地图中
354+
map.addLayer(mapDocLayer);
355+
}
356+
</script>
357+
*/
316358
var Doc = function (opt_name, opt_docName, opt_options) {
317359
this.options = opt_options ? opt_options : {};
318360

@@ -339,6 +381,12 @@ inherits(Doc, ImageLayer);
339381
* Source for MapGIS servers
340382
* 刷新地图,重新取图,但保留了原有的GUID的标识
341383
*/
384+
/**
385+
* @function Zondy.Map.Doc.refresh
386+
* @description 刷新地图,重新取图,但保留了原有的guid的标识。
387+
* @example
388+
* mapDocLayer.refresh()
389+
*/
342390
Doc.prototype.refresh = function () {
343391
this.setSource(null);
344392

@@ -365,6 +413,14 @@ Doc.prototype.refresh = function () {
365413
* 获取地图样式
366414
* 样式类型 Zondy.Object.CDisplayStyle
367415
*/
416+
417+
/**
418+
* @function Zondy.Map.Doc.getStyle
419+
* @description 获取地图文档显示样式参数信息。
420+
* @return {Zondy.Object.CDisplayStyle[]} 描述地图文档显示样式的参数信息.
421+
* @example
422+
* mapDocLayer.getStyle()
423+
*/
368424
Doc.prototype.getStyle = function () {
369425
return this.options.style !== undefined ? this.options.style : null;
370426
};
@@ -373,6 +429,13 @@ Doc.prototype.getStyle = function () {
373429
* Source for MapGIS servers
374430
* 设置地图样式
375431
*/
432+
/**
433+
* @function Zondy.Map.Doc.setStyle(opt_style)
434+
* @description 设置地图文档显示样式参数信息。
435+
* @param opt_style - {Zondy.Object.CDisplayStyle[]} 地图文档显示样式参数。
436+
* @example
437+
* mapDocLayer.setStyle(opt_style)
438+
*/
376439
Doc.prototype.setStyle = function (opt_style) {
377440
if (opt_style !== undefined && opt_style !== null) {
378441
this.style = opt_style;
@@ -385,6 +448,17 @@ Doc.prototype.setStyle = function (opt_style) {
385448
* opt_layers 指定需要被取图的图层序列号,以“,”分隔,如1,2,3
386449
* opt_type 状态类型,赋值类型为Zondy.Enum.Map.LayerStatusType
387450
*/
451+
/**
452+
* @function Zondy.Map.Doc.setLayerStatus(opt_layers, opt_type)
453+
* @description 设置地图文档显示样式参数信息。
454+
* @param opt_layers - {String} 指定需要被取图的图层序列号,以“,”分隔,如“1,2,3”
455+
* @param opt_type - {Zondy.Enum.Map.LayerStatusType} 图层状态类型,show:只显示show参数指定了图层序号的图层,
456+
* hide:显示除hide参数指定图层外所有的图层,include:除显示默认图层(地图文档内图层状态为可见的图层)外,另追加这些被指定的图层显示,追加的这些图层必须为地图中包含的图层
457+
* exclude:从默认图层列表里删除exclude参数指定的图层后,进行显示
458+
* @example
459+
* //第0个图层隐藏
460+
* mapDocLayer.setLayerStatus(0,'hide')
461+
*/
388462
Doc.prototype.setLayerStatus = function (opt_layers, opt_type) {
389463
if (opt_layers !== null && opt_type !== null) {
390464
var layersStatus = opt_type + ":" + opt_layers;
@@ -403,6 +477,17 @@ Doc.prototype.setLayerStatus = function (opt_layers, opt_type) {
403477
* 如:1:name='中华人民共和国'
404478
* 如:FIRST_FIRS='Asia'
405479
*/
480+
/**
481+
* @function Zondy.Map.mapDocLayer.setFilters(opt_filters)
482+
* @description 设置地图文档图层过滤条件。
483+
* @param opt_filters - {String} 过滤条件。如:'1:ID>4,3:ID>1”。
484+
过滤条件中用到的符号包括“==”、“!=”、“<”、“>”、“<=”、“>=”、“..”、“~”等,当包含中文条件时,请使用UTF-8编码格式,其中“:”和“,”为保留字符,用于表示键值对概念和分隔不同图层的条件,请不要将这2个字符用于自定义条件中,javascitpt中请使用encodeURI()函数编码后再代入filters参数中。
485+
* @example
486+
//显示第0个图层,所有id大于1的数据
487+
* var opt_style = '0:id>1';
488+
* mapDocLayer.setFilters(opt_filters)
489+
* mapDocLayer.refresh()
490+
*/
406491
Doc.prototype.setFilters = function (opt_filters) {
407492
if (opt_filters !== null && opt_filters.toString() !== "") {
408493
this.filters = opt_filters;

0 commit comments

Comments
 (0)