Skip to content

Commit aa92a78

Browse files
committed
【fix】fix webmap 对接 restData 数据报错问题 review by songym
1 parent 5b28ffe commit aa92a78

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/mapboxgl/mapping/WebMap.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ export class WebMap extends mapboxgl.Evented {
714714
*/
715715
_addLabelLayer(layerInfo, features) {
716716
let labelStyle = layerInfo.labelStyle;
717-
717+
718718
this.map.addLayer({
719719
"id": layerInfo.layerID + 'label',
720720
"type": "symbol",
@@ -731,7 +731,7 @@ export class WebMap extends mapboxgl.Evented {
731731
"layout": {
732732
"text-field": `{${labelStyle.labelField}}`,
733733
'text-size': parseFloat(labelStyle.fontSize) || 12,
734-
'text-offset': labelStyle.offsetX ? [labelStyle.offsetX / 10 || 0, labelStyle.offsetY / 10 || 0] : [0,-1.5],
734+
'text-offset': labelStyle.offsetX ? [labelStyle.offsetX / 10 || 0, labelStyle.offsetY / 10 || 0] : [0, -1.5],
735735
'text-font': ["DIN Offc Pro Italic", "Arial Unicode MS Regular"],
736736
'visibility': layerInfo.visible
737737
}
@@ -1715,6 +1715,7 @@ export class WebMap extends mapboxgl.Evented {
17151715
allFeatures[i].properties.lat = coordinate[1];
17161716
}
17171717
}
1718+
features.properties['index'] = i + '';
17181719
features.push(feature);
17191720
}
17201721
return features;

0 commit comments

Comments
 (0)