Skip to content

Commit bbacd0a

Browse files
committed
2 parents 8193292 + 25af9ff commit bbacd0a

Some content is hidden

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

44 files changed

+1694
-492
lines changed

build/jsdocs/openlayers/docs.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@
6262
"src/common/components/templates/PopContainer",
6363
"src/common/components/templates/Select",
6464
"src/common/security/KeyServiceParameter",
65-
"src/common/components/templates/TemplateBase",
66-
67-
"src/openlayers/core/Util"
65+
"src/common/components/templates/TemplateBase"
6866
]
6967
},
7068
"plugins": ["plugins/markdown","../plugins/usage", "../plugins/moduleCategories"],

build/server.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ const serveIndex = require('serve-index');
55

66
const webpack = require('webpack');
77
const webpackDevMiddleware = require('webpack-dev-middleware');
8+
89
const product = process.argv[2];
910
var dirname = product === 'openlayers' ? 'ol' : product
1011
const app = (module.exports = express());
1112
if (product) {
1213
const config = require(`./webpack.config.${product}.js`);
1314
const configBase = require(`./webpack.config.base.js`);
14-
const entry = [`./src/${product}/${product === 'classic'? 'index': 'namespace'}.js`];
15+
const entry = [`./src/${product}/namespace.js`];
1516
const filename = `iclient-${dirname}`;
1617
config.output.filename = `${filename}-es6.min.js`;
1718
config.output.path = path.resolve(`${__dirname}/../dist/${dirname}`);

examples/leaflet/01_chartService.html

+104-100
Large diffs are not rendered by default.

examples/mapboxgl/01_chartService.html

+105-101
Large diffs are not rendered by default.

examples/openlayers/01_chartService.html

+106-103
Large diffs are not rendered by default.

src/classic/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ export { OutputSetting } from '@supermap/iclient-common/iServer/OutputSetting';
1616
export { MappingParameters } from '@supermap/iclient-common/iServer/MappingParameters';
1717
export { GeoCodingParameter } from '@supermap/iclient-common/iServer/GeoCodingParameter';
1818
export { GeoDecodingParameter } from '@supermap/iclient-common/iServer/GeoDecodingParameter';
19+
export { VectorClipJobsParameter } from '@supermap/iclient-common/iServer/VectorClipJobsParameter';
1920
export { Util } from '@supermap/iclient-common/commontypes/Util';
21+
export { FetchRequest } from '@supermap/iclient-common/util/FetchRequest';
2022
export * from './overlay';
2123
export * from './services';
2224
export { SuperMap } from './SuperMap';

src/classic/namespace.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
ElasticSearch,
33
SecurityManager,
4+
VectorClipJobsParameter,
45
KernelDensityJobParameter,
56
SingleObjectQueryJobsParameter,
67
SummaryAttributesJobsParameter,
@@ -14,11 +15,13 @@ import {
1415
GeoCodingParameter,
1516
GeoDecodingParameter,
1617
SuperMap,
17-
Util
18+
Util,
19+
FetchRequest
1820
} from './index';
1921

2022
SuperMap.ElasticSearch = ElasticSearch;
2123
SuperMap.SecurityManager = SecurityManager;
24+
SuperMap.VectorClipJobsParameter = VectorClipJobsParameter;
2225
SuperMap.KernelDensityJobParameter = KernelDensityJobParameter;
2326
SuperMap.SingleObjectQueryJobsParameter = SingleObjectQueryJobsParameter;
2427
SuperMap.SummaryAttributesJobsParameter = SummaryAttributesJobsParameter;
@@ -31,5 +34,6 @@ SuperMap.OutputSetting = OutputSetting;
3134
SuperMap.MappingParameters = MappingParameters;
3235
SuperMap.GeoCodingParameter = GeoCodingParameter;
3336
SuperMap.GeoDecodingParameter = GeoDecodingParameter;
37+
SuperMap.FetchRequest = FetchRequest;
3438
SuperMap.Util = {...SuperMap.Util, ...Util};
3539
export * from './index';

src/common/iServer/ChartQueryService.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ export class ChartQueryService extends CommonServiceBase {
162162
this._transformFeatures(recordsets[i], fieldNameFormatter, me.format)
163163
}
164164
// 点选查询的返回结果
165-
if(recordsets[i].chartFeatureRecordsets) {
166-
recordsets[i].chartFeatureRecordsets.forEach(chartFeatureRecordset => {
165+
if(recordsets[i].chartRecordsets) {
166+
recordsets[i].chartRecordsets.forEach(chartFeatureRecordset => {
167167
this._transformFeatures(chartFeatureRecordset, fieldNameFormatter, me.format)
168168
});
169169
}

src/common/iServer/ChartSetting.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* @param {boolean} [options.textClipRegionEnabled=false] - 是否启用海图图层的文本显示裁剪区。
4040
* @param {boolean} [options.displayLowAccurateMarker=true] - 是否显示低精度符号。
4141
* @param {number} [options.displayScaleFactor] - 比例尺缩放。
42-
* @param {object} [options.chartAcronymClassify] - 物标分组是否可显示的对应关系。
42+
* @param {object} [options.displayableAcronymClassify] - 物标分组是否可显示的对应关系。
4343
* @usage
4444
*/
4545
export class ChartSetting {
@@ -208,10 +208,10 @@
208208
this.displayScaleFactor = 0.05;
209209

210210
/**
211-
* @member {object} [options.chartAcronymClassify]
211+
* @member {object} [options.displayableAcronymClassify]
212212
* @description 物标分组是否可显示的对应关系。
213213
*/
214-
this.chartAcronymClassify = null;
214+
this.displayableAcronymClassify = null;
215215

216216
if (options) {
217217
Util.extend(this, options);
@@ -252,7 +252,7 @@
252252
this.textClipRegionEnabled = null;
253253
this.displayLowAccurateMarker = null;
254254
this.displayScaleFactor = null;
255-
this.chartAcronymClassify = null;
255+
this.displayableAcronymClassify = null;
256256
}
257257
}
258258

src/common/iServer/GetFeaturesByBufferService.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,7 @@ export class GetFeaturesByBufferService extends GetFeaturesServiceBase {
4747
* @returns {Object} 转化后的 JSON 字符串。
4848
*/
4949
getJsonParameters(params) {
50-
if (!(params instanceof GetFeaturesByBufferParameters)) {
51-
return;
52-
}
53-
return GetFeaturesByBufferParameters.toJsonParameters(params);
50+
return GetFeaturesByBufferParameters.toJsonParameters(params);
5451
}
5552

5653
}

src/common/iServer/GetFeaturesServiceBase.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,15 @@ export class GetFeaturesServiceBase extends CommonServiceBase {
129129
console.warn('recommend set returnFeaturesOnly config to true to imporve performance. if need get Total amount and Dataset information. FeatureService provide getFeaturesCount and getFeaturesDatasetInfo method');
130130
}
131131
if (params.returnCountOnly) {
132-
me.url = Util.urlAppend(me.url, "&returnCountOnly=" + params.returnCountOnly)
132+
me.url = Util.urlAppend(me.url, "returnCountOnly=" + params.returnCountOnly)
133133
}
134134

135135
if (params.returnDatasetInfoOnly) {
136-
me.url = Util.urlAppend(me.url, "&returnDatasetInfoOnly=" + params.returnDatasetInfoOnly)
136+
me.url = Util.urlAppend(me.url, "returnDatasetInfoOnly=" + params.returnDatasetInfoOnly)
137137
}
138138

139139
if (params.returnFeaturesOnly) {
140-
me.url = Util.urlAppend(me.url, "&returnFeaturesOnly=" + params.returnFeaturesOnly)
140+
me.url = Util.urlAppend(me.url, "returnFeaturesOnly=" + params.returnFeaturesOnly)
141141
}
142142
}
143143

src/common/overlay/graticule/GraticuleLayerRenderer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ export class GraticuleLayerRenderer {
185185
this.oldExtent = this.options.extent;
186186
this._calcInterval();
187187
this.isRotate = false;
188-
this.visible = true;
188+
this.visible = this.options.visible;
189189
this.features = this._getGraticuleFeatures();
190190
}
191191

src/common/overlay/knowledge-graph/format.js

+15-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
import uniqBy from 'lodash.uniqby';
22

33
export function transformGraphMap(data, graphMap) {
4-
const style = graphMap && graphMap.styles && graphMap.styles.style;
5-
const captionField = graphMap && graphMap.captionFields && graphMap.captionFields.captionField;
4+
graphMap = graphMap || {};
5+
const style = graphMap.styles && graphMap.styles.style;
6+
const captionField = graphMap.captionFields && graphMap.captionFields.captionField;
7+
const showRelationTypes = graphMap.showRelationTypes;
68

79
const rst = { nodes: [], edges: [] };
810
data.forEach((item) => {
911
const pathData = item.path;
1012
if (pathData) {
11-
const { nodes, edges } = transformPath(pathData, style, captionField);
13+
const { nodes, edges } = transformPath(pathData, style, captionField, showRelationTypes);
1214
rst.nodes.push(...nodes);
1315
rst.edges.push(...edges);
1416
} else if (isEdge(item)) {
15-
const edge = edgeFromGraphMap(item, style);
17+
const edge = edgeFromGraphMap(item, style, showRelationTypes);
1618
rst.edges.push(edge);
1719
} else {
1820
const node = nodeFromGraphMap(item, style, captionField);
@@ -30,11 +32,11 @@ function isEdge(entity) {
3032
return entity.hasOwnProperty('start') && entity.hasOwnProperty('end');
3133
}
3234

33-
function transformPath(pathData, style, captionField) {
35+
function transformPath(pathData, style, captionField, showRelationTypes) {
3436
const rst = { nodes: [], edges: [] };
3537
pathData.forEach((item) => {
3638
if (isEdge(item)) {
37-
const edge = edgeFromGraphMap(item, style);
39+
const edge = edgeFromGraphMap(item, style, showRelationTypes);
3840
rst.edges.push(edge);
3941
} else {
4042
const node = nodeFromGraphMap(item, style, captionField);
@@ -51,7 +53,7 @@ export function nodeFromGraphMap(entity, style, captionField) {
5153
const fillColor = styleData.fillColor || '';
5254
const node = {
5355
id: id + '',
54-
label: label,
56+
label: label === undefined ? '' : label + '',
5557
properties,
5658
lables
5759
};
@@ -73,7 +75,7 @@ export function nodeFromGraphMap(entity, style, captionField) {
7375
}
7476
return node;
7577
}
76-
export function edgeFromGraphMap(entity, style) {
78+
export function edgeFromGraphMap(entity, style, showRelationTypes) {
7779
const { start, end, id, type, properties } = entity;
7880
const styleData = style ? getEdgeStyle(entity, style) : {};
7981
const edge = {
@@ -85,6 +87,9 @@ export function edgeFromGraphMap(entity, style) {
8587
labelCfg: {},
8688
properties
8789
};
90+
if (showRelationTypes === false) {
91+
delete edge.label;
92+
}
8893
if (styleData.stroke) {
8994
edge.style.stroke = styleData.stroke;
9095
edge.style.endArrow = {
@@ -161,11 +166,11 @@ function getNodeLabel(entity, captionField) {
161166
const types = JSON.parse(entityTypes || '[]');
162167
const labelStr = labels && labels.join('&');
163168
if (ids.includes(id) || types.includes(labelStr)) {
164-
return properties[name] || '';
169+
return properties[name];
165170
}
166171
}
167172
}
168-
return properties[properties._labelfieldname] || '';
173+
return properties[properties._labelfieldname];
169174
}
170175

171176
function formatFontStyle(fontStyle) {

src/leaflet/core/CommontypesConversion.js

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ export const CommontypesConversion = {
4141
bounds.max.y
4242
);
4343
}
44+
if (bounds instanceof Bounds) {
45+
return bounds;
46+
}
4447
if (isArray(bounds)) {
4548
return new Bounds(
4649
bounds[0],

src/mapboxgl/core/MapExtend.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { getServiceKey } from '@supermap/iclient-common/util/EncryptRequest';
1111
* @private
1212
*/
1313
export var MapExtend = (function () {
14-
if (mapboxgl.VectorTileSource.prototype.beforeLoadBak === undefined) {
14+
if (mapboxgl.VectorTileSource && mapboxgl.VectorTileSource.prototype.beforeLoadBak === undefined) {
1515
mapboxgl.VectorTileSource.prototype.beforeLoadBak = mapboxgl.VectorTileSource.prototype.beforeLoad;
1616
mapboxgl.VectorTileSource.prototype.beforeLoad = async function (id, options) {
1717
const url = options && options.tiles && options.tiles[0];

src/mapboxgl/core/Util.js

+3
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ export const Util = {
5858
if (bounds instanceof mapboxgl.LngLatBounds) {
5959
return new Bounds(bounds.getWest(), bounds.getSouth(), bounds.getEast(), bounds.getNorth());
6060
}
61+
if (bounds instanceof Bounds) {
62+
return bounds;
63+
}
6164
return bounds;
6265
},
6366

src/mapboxgl/core/decryptSource.js

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* @name decryptSources
33
* @namespace
44
* @category BaseTypes Util
5+
* @version 11.2.0
56
* @description 配置需要解密的矢量瓦片的sourceId。
67
* @usage
78
* ```
@@ -24,6 +25,7 @@ const decryptSources = {
2425
* @description 设置需要解密的矢量瓦片的sourceId数组
2526
* @param {Array.<string>} sourceIds sourceId数组
2627
* @returns {Array.<string>} sourceId数组
28+
* @version 11.2.0
2729
*/
2830
set(sourceIds) {
2931
this.values = sourceIds;
@@ -34,6 +36,7 @@ const decryptSources = {
3436
* @description 添加需要解密的矢量瓦片的sourceId
3537
* @param {string} sourceId sourceId
3638
* @returns {Array.<string>} sourceId
39+
* @version 11.2.0
3740
*/
3841
add(sourceId) {
3942
this.values.push(sourceId);

src/mapboxgl/mapping/InitMap.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export function initMap(url, options = {}) {
5555
}
5656
const mapOptions = await createMapOptions(url, res.result, { ...options, initMapService });
5757
const map = new mapboxgl.Map(mapOptions);
58-
if (mapOptions.style && mapOptions.style.layers && mapOptions.style.layers.length > 0) {
58+
if (!map.loaded()) {
5959
map.on('load', () => {
6060
resolve({ map });
6161
});

src/maplibregl/core/Util.js

+3
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ export const Util = {
5858
if (bounds instanceof maplibregl.LngLatBounds) {
5959
return new Bounds(bounds.getWest(), bounds.getSouth(), bounds.getEast(), bounds.getNorth());
6060
}
61+
if (bounds instanceof Bounds) {
62+
return bounds;
63+
}
6164
return bounds;
6265
},
6366

0 commit comments

Comments
 (0)