MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / _getPopupInfos

Method _getPopupInfos

src/common/mapping/WebMapV2.js:185–211  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

183 return epsgCode;
184 }
185 _getPopupInfos() {
186 const { layers = [] } = this._mapInfo;
187 return layers.map((layer) => {
188 const { popupInfo, enableFields, name, layerID: layerId, captions: fieldCaptions } = layer;
189 if (popupInfo){
190 let elements = popupInfo.elements || [];
191 if (fieldCaptions) {
192 elements = (popupInfo.elements || []).map(item => {
193 if (item.type === 'FIELD') {
194 item.fieldCaption = fieldCaptions[item.fieldName] || item.fieldName;
195 }
196 return item;
197 });
198 }
199 return { ...popupInfo, layerId: [layerId], elements, title: name };
200 }
201 if (enableFields) {
202 const elements = enableFields.map((fieldName) => ({
203 type: 'FIELD',
204 fieldName,
205 fieldCaption: fieldCaptions ? (fieldCaptions[fieldName] || fieldName) : fieldName
206 }));
207 return { elements, layerId: [layerId], title: name };
208 }
209 return null;
210 }).filter(item => item !== null);
211 }
212
213 _handleLayerInfo(mapInfo, _taskID) {
214 mapInfo = this._setLayerID(mapInfo);

Callers 2

WebMapV3Spec.jsFile · 0.45
getPopupInfosMethod · 0.45

Calls 2

filterMethod · 0.80
mapMethod · 0.80

Tested by

no test coverage detected