Skip to content

Commit e5be340

Browse files
author
潘卓然ParnDeedlit
committed
【站点】【升级】【修复移动端的样式细节】
2 parents 7d19190 + 9bab041 commit e5be340

File tree

12 files changed

+931
-122
lines changed

12 files changed

+931
-122
lines changed

docs/cdn/mapgis.css

Lines changed: 287 additions & 50 deletions
Large diffs are not rendered by default.

docs/jsdoc-config/mapboxgl/docs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636
"better-docs": {
3737
"logo": "../image/mapgis_blue.png",
38-
"title": "",
38+
"title": "Client for JavaScript",
3939
"hideGenerator": false,
4040
"navLinks": [
4141
{

docs/jsdoc-config/mapboxgl/index.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,23 @@
2222

2323
#### IGServer
2424
> igserver的Object,Catalog,Service的对象的分类与封装
25-
>> [Zondy.Object.Feature](Zondy.Object.Feature.html)<br>
26-
>> [Zondy.Catalog.MapDoc](Zondy.Catalog.MapDoc.html)<br>
27-
>> [Zondy.Service.GetDocImageService](Zondy.Service.GetDocImageService.html)<br>
25+
>
26+
> [Zondy.Object.Feature](Zondy.Object.Feature.html)<br>
27+
> [Zondy.Catalog.MapDoc](Zondy.Catalog.MapDoc.html)<br>
28+
> [Zondy.Service.GetDocImageService](Zondy.Service.GetDocImageService.html)<br>
2829
2930
#### DataStore
3031

3132
> ElasticSearch的时空聚类效果
32-
>> [mapboxgl.zondy.GeoHashService](mapboxgl.zondy.GeoHashService.html)<br>
33+
>
34+
> [mapboxgl.zondy.GeoHashService](mapboxgl.zondy.GeoHashService.html)<br>
3335
3436
#### D3,Echarts,MapV
3537

3638
> 丰富的可视化效果,矢量瓦片、客户端专题图、开源可视化库[ECharts](http://echarts.baidu.com/)[MapV](http://mapv.baidu.com/)
37-
>> [mapboxgl.zondy.EchartsLayer](mapboxgl.zondy.EchartsLayer.html)<br>
38-
>> [mapboxgl.zondy.MapvLayer](mapboxgl.zondy.MapvLayer.html)<br>
39+
>
40+
> [mapboxgl.zondy.EchartsLayer](mapboxgl.zondy.EchartsLayer.html)<br>
41+
> [mapboxgl.zondy.MapvLayer](mapboxgl.zondy.MapvLayer.html)<br>
3942
4043

4144
#### 参考API

docs/templates/better-docs/publish.js

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ function buildMemberNav(items, itemHeading, itemsSeen, linktoFn) {
356356
if (subCategoryName) {
357357
heading = heading + ' / ' + subCategoryName
358358
}
359-
nav += '<h3>' + heading + '</h3><ul>' + itemsNav + '</ul>'
359+
nav += '<div class="mapgis-menu-span">' + heading + '</div><ul class="mapgis-sidebar-menus">' + itemsNav + '</ul>'
360360
}
361361
}
362362
})
@@ -379,7 +379,7 @@ function buildGroupNav (members, title) {
379379
var seen = {}
380380
nav += '<div class="category">'
381381
if (title) {
382-
nav += '<h2>' + title + '</h2>'
382+
nav += '<span class="mapgis-menu-span">' + title + '</span>'
383383
}
384384
/* nav += buildMemberNav(members.tutorials || [], 'Tutorials', seenTutorials, linktoTutorial)
385385
nav += buildMemberNav(members.modules || [], 'Modules', {}, linkto)
@@ -413,16 +413,37 @@ function buildGroupNav (members, title) {
413413

414414
if (!globalNav) {
415415
// turn the heading into a link so you can actually get to the global page
416-
nav += '<h3>' + linkto('global', '全局') + '</h3>'
416+
nav += '<div class="mapgis-menu-span">' + linkto('global', '全局') + '</div>'
417417
}
418418
else {
419-
nav += '<h3>全局</h3><ul>' + globalNav + '</ul>'
419+
nav += '<div class="mapgis-menu-span">全局</div><ul class="mapgis-sidebar-menus">' + globalNav + '</ul>'
420420
}
421421
}
422422
nav += '</div>'
423423
return nav
424424
}
425425

426+
/**
427+
* Create the navigation sidebar.
428+
* @param {object} members The members that will be used to create the sidebar.
429+
* @param {array<object>} members.classes
430+
* @param {array<object>} members.components
431+
* @param {array<object>} members.externals
432+
* @param {array<object>} members.globals
433+
* @param {array<object>} members.mixins
434+
* @param {array<object>} members.modules
435+
* @param {array<object>} members.namespaces
436+
* @param {array<object>} members.tutorials
437+
* @param {array<object>} members.events
438+
* @param {array<object>} members.interfaces
439+
* @return {string} The HTML for the navigation sidebar.
440+
*/
441+
function buildApiLink(members, navTypes = null, betterDocs) {
442+
const href = betterDocs.landing ? 'docs.html' : 'index.html'
443+
var nav = `<span class="mapgis-api-document-span"><a href="${href}">API文档</a></span>`
444+
return nav
445+
}
446+
426447
/**
427448
* Create the navigation sidebar.
428449
* @param {object} members The members that will be used to create the sidebar.
@@ -440,7 +461,8 @@ function buildGroupNav (members, title) {
440461
*/
441462
function buildNav(members, navTypes = null, betterDocs) {
442463
const href = betterDocs.landing ? 'docs.html' : 'index.html'
443-
var nav = navTypes ? '' : `<h2><a href="${href}">API文档</a></h2>`
464+
// var nav = navTypes ? '' : `<span class="mapgis-api-document-span"><a href="${href}">API文档</a></span>`
465+
var nav = ''
444466

445467
var categorised = {}
446468
var rootScope = {}
@@ -705,6 +727,7 @@ exports.publish = function(taffyData, opts, tutorials) {
705727
view.outputSourceFiles = outputSourceFiles
706728

707729
// once for all
730+
view.apilink = buildApiLink(members, null, conf.betterDocs)
708731
view.nav = buildNav(members, null, conf.betterDocs)
709732
view.tutorialsNav = buildNav(members, ['tutorials'], conf.betterDocs)
710733
bundler(members.components, outdir, conf)

docs/templates/better-docs/tmpl/container.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
<div class="members">
6565
<div class="member">
6666
<div class=name>
67-
<span class="tag">构造函数</span>
67+
<span class="mapgis-api-function">Fx</span><span class="mapgis-api-function-title">构造函数</span>
6868
</div>
6969
<?js= self.partial('method.tmpl', doc) ?>
7070
</div>

docs/templates/better-docs/tmpl/layout.tmpl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ var search = env.conf.templates && env.conf.templates.search
2626
class="sidebar <?js= isTutorial ? 'tutorials' : '' ?>"
2727
id="sidebarNav"
2828
>
29+
<div>
30+
<?js= this.apilink ?>
31+
</div>
2932
<?js if(search) { ?>
3033
<div class="search-wrapper">
3134
<input id="search" type="text" placeholder="搜索文档..." class="input">
@@ -42,8 +45,8 @@ var search = env.conf.templates && env.conf.templates.search
4245
<div class="core" id="main-content-wrapper">
4346
<div class="content">
4447
<header class="page-title">
45-
<p><?js= subtitle ?></p>
46-
<h1><?js= title ?></h1>
48+
<span class="page-title-sub"><?js= title ?></span>
49+
<span class="page-title-main"><?js= subtitle ?></span>
4750
</header>
4851
<?js= content ?>
4952
</div>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import { MapGIS } from '../Base';
2+
import { ServiceBase } from '../ServiceBase';
3+
4+
/**
5+
* @author 基础平台-潘卓然
6+
* @class module:OGC服务.OGCService
7+
* @classdesc OGC服务类
8+
* @description Mapgis.OGC.OGCService
9+
* @extends ServiceBase
10+
* @param option - {Object} 属性键值对。<br>
11+
* @param {String} [option.baseUrl = igs/rest/ogc] 基本地址
12+
* @param {String} [option.url = ""] 必选。服务url
13+
*/
14+
class OGCService extends ServiceBase {
15+
constructor(option) {
16+
var options = option || {};
17+
options.baseUrl = 'igs/rest/ogc';
18+
super(options);
19+
}
20+
21+
/**
22+
* @description 向服务器发送GET请求
23+
* @function module:OGC.OGCService.prototype.get
24+
* @param {String} url 完整的请求地址。
25+
* @param {Function} onSuccess 查询成功回调函数。
26+
* @param {Function} onError 查询失败回调函数。
27+
*/
28+
get(url, onSuccess, onError) {
29+
var me = this;
30+
var service = new IgsServiceBase(url, {
31+
eventListeners: {
32+
scope: me,
33+
processCompleted: onSuccess,
34+
processFailed: onError
35+
}
36+
});
37+
service.processAsync();
38+
}
39+
40+
/**
41+
* @description 向服务器发送POST请求
42+
* @function module:OGC.OGCService.prototype.post
43+
* @param {String} url 完整的请求地址。
44+
* @param {Function} onSuccess 查询成功回调函数。
45+
* @param {Function} onError 查询失败回调函数。
46+
*/
47+
post(url, param, onSuccess, onError) {
48+
var me = this;
49+
var service = new IgsServiceBase(url, {
50+
eventListeners: {
51+
scope: me,
52+
processCompleted: onSuccess,
53+
processFailed: onError
54+
}
55+
});
56+
service.processAsync({
57+
method: 'POST',
58+
data: JSON.stringify(param),
59+
headers: { 'Content-Type': 'text/plain;charset=UTF-8' }
60+
});
61+
}
62+
}
63+
export { OGCService };
64+
MapGIS.OGC.OGCService = OGCService;
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
import { MapGIS } from '../Base';
2+
import { OGCService } from './OGCService';
3+
import xml from 'fast-xml-parser';
4+
import axios from 'axios';
5+
import qs from 'qs';
6+
7+
/**
8+
* @author 基础平台-潘卓然
9+
* @class module:OGC服务.OGCService
10+
* @classdesc OGC服务类
11+
* @description MapGIS.OGC.OGCService
12+
* @extends OGCService
13+
* @link https://www.ogc.org/standards/wfs
14+
* @param option - {Object} 属性键值对。<br>
15+
* @param {String} [option.url = ""] 必选。服务url
16+
* @param {String} [option.version = "1.1.1"] 请求的版本号,1.1.1或1.3.0,服务默认版本为1.1.1。(getWMSInfo,getFeatureInfo)
17+
*/
18+
class WFS extends OGCService {
19+
constructor(option) {
20+
var options = option || {};
21+
super(options);
22+
this.url = options.url;
23+
this.featureTypes = [];
24+
this.layers = [];
25+
}
26+
27+
isBaseUrl() {
28+
let valid = false;
29+
const name = 'WFSServer';
30+
const length = this.url.length;
31+
const index = this.url.indexOf(name) + name.length;
32+
let fullurl;
33+
if (index === length) {
34+
fullurl = `${this.url}?request=GetCapabilities&service=WFS`;
35+
valid = true;
36+
} else if (index === length - 1) {
37+
fullurl = `${this.url}request=GetCapabilities&service=WFS`;
38+
valid = true;
39+
}
40+
return valid;
41+
}
42+
43+
setVersion(version) {
44+
this.version = version;
45+
return this;
46+
}
47+
48+
setCrs(crs) {
49+
this.srsname = crs;
50+
return this;
51+
}
52+
53+
setName(name) {
54+
this.typename = name;
55+
return this;
56+
}
57+
58+
setOutputFormat(format) {
59+
this.outputFormat = format;
60+
}
61+
62+
async getCapabilities() {
63+
const name = 'WFSServer';
64+
const length = this.url.length;
65+
const index = this.url.indexOf(name) + name.length;
66+
let fullurl = this.url;
67+
if (index === length) {
68+
fullurl = `${this.url}?request=GetCapabilities&service=WFS`;
69+
} else if (index === length - 1) {
70+
fullurl = `${this.url}request=GetCapabilities&service=WFS`;
71+
}
72+
let res = await axios.get(fullurl);
73+
let data = res.data;
74+
let obj = xml.getTraversalObj(data, {});
75+
let json = xml.convertToJson(obj, {});
76+
let version = json['wfs:WFS_Capabilities']['ows:ServiceIdentification']['ows:ServiceTypeVersion'];
77+
if (version === '1.1.0') {
78+
// MapGIS 10.3.5 10.5.0
79+
this.featureTypes = json['wfs:WFS_Capabilities']['FeatureTypeList']['FeatureType'];
80+
let crs;
81+
let name = '';
82+
this.featureTypes.forEach((f, i) => {
83+
if (i == 0) {
84+
crs = f['DefaultSRS'];
85+
name = `${f['Name']}`;
86+
}
87+
});
88+
this.layers = this.featureTypes.map((f) => f['Name']);
89+
this.setName(name).setCrs(crs).setVersion(version).setOutputFormat('text/xml; subtype=gml/3.2');
90+
} else if (version === '2.0.0') {
91+
let featureType = json['wfs:WFS_Capabilities']['wfs:FeatureTypeList']['wfs:FeatureType'];
92+
let crs = featureType['wfs:DefaultCRS'];
93+
let name = featureType['wfs:Name'];
94+
this.setName(name).setCrs(crs).setVersion(version);
95+
}
96+
return json;
97+
}
98+
99+
async getFeature() {
100+
const name = 'WFSServer';
101+
const length = this.url.length;
102+
const index = this.url.indexOf(name) + name.length;
103+
let fullurl = this.url;
104+
105+
let { maxFeatures = 100, version = '1.1.0', typename = '', outputFormat, srsname = 'EPSG:4326', bbox } = this;
106+
let object = {
107+
service: 'WFS',
108+
request: 'GetFeature',
109+
version,
110+
typename,
111+
outputFormat,
112+
srsname,
113+
maxFeatures
114+
};
115+
116+
if (version === '1.1.0') {
117+
if (bbox) {
118+
object = { ...object, bbox: `${bbox},${srsname}` };
119+
} else {
120+
object = { ...object };
121+
}
122+
} else if (version === '2.0.0') {
123+
object = { ...object, Envelope: `${bbox},${srsname}` };
124+
}
125+
126+
if (index === length) {
127+
fullurl = `${this.url}?${qs.stringify(object)}`;
128+
} else if (index === length - 1) {
129+
fullurl = `${this.url}${qs.stringify(object)}`;
130+
}
131+
132+
let res = await axios.get(fullurl);
133+
let data = res.data;
134+
let obj = xml.getTraversalObj(data, {});
135+
let json = xml.convertToJson(obj, {});
136+
137+
let result = {
138+
geojson: undefined,
139+
xml: json
140+
};
141+
let geojson;
142+
switch (version) {
143+
case '1.1.0':
144+
geojson = convert
145+
break;
146+
case '2.0.0':
147+
break;
148+
}
149+
return result;
150+
}
151+
}
152+
export { WFS };
153+
MapGIS.OGC.WFS = WFS;

0 commit comments

Comments
 (0)