Skip to content

Commit 7beb85a

Browse files
committed
优化代码
1 parent d70246c commit 7beb85a

File tree

6 files changed

+22
-13
lines changed

6 files changed

+22
-13
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@
88

99
- `L.supermap.tiledVectorLayer` 新增 `options.processCharacters` 参数,支持本地设置服务端的CartoCSS样式时替换特殊字符
1010

11+
- `SuperMap.QueryParameters` 及其子类新增 `options.returnFeatureWithFieldCaption` 参数,支持指定返回的查询结果要素字段标识为字段别名
12+
13+
### for OpenLayers
14+
15+
- `SuperMap.QueryParameters` 及其子类新增 `options.returnFeatureWithFieldCaption` 参数,支持指定返回的查询结果要素字段标识为字段别名
16+
17+
### for MapboxGL
18+
19+
- `SuperMap.QueryParameters` 及其子类新增 `options.returnFeatureWithFieldCaption` 参数,支持指定返回的查询结果要素字段标识为字段别名
20+
1121
## Fixed
1222

1323
### for Leaflet

src/common/overlay/levelRenderer/Area.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,11 +324,7 @@ export class Area {
324324
}
325325

326326
// 捕获判断
327-
if (isOnBase === true && isOnHole === false) {
328-
return true;
329-
} else {
330-
return false;
331-
}
327+
return isOnBase === true && isOnHole === false;
332328
} else {
333329
return this.isInsidePolygon(area.pointList, icX, icY);
334330
}

src/common/overlay/levelRenderer/Env.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ export class Env {
7676
os.version = blackberry[2];
7777
}
7878
if (bb10) {
79-
os.bb10 = true, os.version = bb10[2];
79+
os.bb10 = true;
80+
os.version = bb10[2];
8081
}
8182
if (rimtabletos) {
8283
os.rimtabletos = true;

src/leaflet/overlay/TileVectorLayer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ export var TileVectorLayer = VectorGrid.extend({
300300
feature = this._mergeFeatureTextField(feature, style);
301301

302302
//次优先级是layers资源的默认的样式,最低优先级是CartoDefaultStyle的样式
303-
if (feature.type === "TEXT") {
303+
if (feature.type === "TEXT" || style.length === 0) {
304304
style = this.cartoCSSToLeaflet.getValidStyleFromLayerInfo(feature, layerStyleInfo);
305305
if (feature.type === "TEXT") {
306306
style.textName = "[" + feature.properties.textField + "]";

src/leaflet/overlay/carto/CartoCSSToLeaflet.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -256,16 +256,18 @@ export class CartoCSSToLeaflet {
256256
var value = _shader.getValue(attributes, zoom, true);
257257
if ((value !== null) && prop) {
258258
if (prop === "fontSize") {
259-
value = fromServer ? value *= 0.8 : value;
260-
fontSize = value + "px";
261-
style.fontSize = fontSize;
259+
if (fromServer) {
260+
value *= 0.8
261+
}
262+
fontSize = value + "px";
263+
style.fontSize = fontSize;
262264
} else if (prop === "fontName") {
263265
fontName = value;
264266
style.fontName = fontName;
265267
} else {
266268
if (prop === "globalCompositeOperation") {
267269
value = CompOpMap[value];
268-
if (!value || value === "") {
270+
if (!value) {
269271
continue;
270272
}
271273
} else if (fromServer && prop === 'iconUrl') {
@@ -417,7 +419,7 @@ export class CartoCSSToLeaflet {
417419
}
418420

419421
//处理标签文本的情况
420-
if (layerInfo && layerInfo.textField) {
422+
if (layerInfo.textField) {
421423
style.textAlign = "LEFT";
422424
}
423425
return style;

src/mapboxgl/overlay/GraphThemeLayer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ export class Graph extends Theme {
198198
// 获取地图像素 bounds
199199
var mapPxLT = this.getLocalXY(new LonLat(mapBounds.left, mapBounds.top));
200200
var mapPxRB = this.getLocalXY(new LonLat(mapBounds.right, mapBounds.bottom));
201-
var mBounds = new Bounds(mapPxLT[0], mapPxRB[1], mapPxRB[0], mapPxLT[1]);
201+
//var mBounds = new Bounds(mapPxLT[0], mapPxRB[1], mapPxRB[0], mapPxLT[1]);
202202
// 压盖处理 & 添加图形
203203
for (let i = 0, len = charts.length; i < len; i++) {
204204
var chart = charts[i];

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy