Skip to content

Commit 3ef6f9f

Browse files
committed
fix 海图示例sql查询返回要素可能没有Acronym字段而报错
1 parent fe0b011 commit 3ef6f9f

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

examples/leaflet/01_chartService.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -637,15 +637,15 @@ <h5 class='panel-title text-center'>
637637
};
638638
}}
639639

640+
var featuresListEle = document.getElementById("featuresList");
641+
var localName = featuresListEle.options[featuresListEle.selectedIndex].text;
642+
640643
new L.supermap.ChartService(url).queryChart(chartQueryParameters).then(function(res) {
641644
var queryRes = res.result.recordsets;
642645
queryResults.innerHTML = queryRes.length ? '': resources.text_queryEmpty;;
643646
queryRes.forEach(function(recordset) {
644647
allFeatures.features.push(...recordset.features.features);
645648
recordset.features.features.forEach(function(feature) {
646-
var localName = featureInfos.find(function(featureInfo) {
647-
return featureInfo.acronym === feature.properties.Acronym;
648-
}).localName;
649649
var type = feature.geometry.type;
650650

651651
var acronym = document.createElement('li');

examples/mapboxgl/01_chartService.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -694,15 +694,15 @@ <h5 class='panel-title text-center'>
694694
};
695695
}}
696696

697+
var featuresListEle = document.getElementById("featuresList");
698+
var localName = featuresListEle.options[featuresListEle.selectedIndex].text;
699+
697700
new mapboxgl.supermap.ChartService(url).queryChart(chartQueryParameters).then(function(res) {
698701
var queryRes = res.result.recordsets;
699702
queryResults.innerHTML = queryRes.length ? '': resources.text_queryEmpty;
700703
queryRes.forEach(function(recordset) {
701704
allFeatures.features.push(...recordset.features.features);
702705
recordset.features.features.forEach(function(feature) {
703-
var localName = featureInfos.find(function(featureInfo) {
704-
return featureInfo.acronym === feature.properties.Acronym;
705-
}).localName;
706706
var type = feature.geometry.type;
707707

708708
var acronym = document.createElement('li');

examples/openlayers/01_chartService.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -662,16 +662,15 @@ <h5 class='panel-title text-center'>
662662
color: 'rgba(255, 0, 0, 0.1)'
663663
})
664664
});
665+
var featuresListEle = document.getElementById("featuresList");
666+
var localName = featuresListEle.options[featuresListEle.selectedIndex].text;
665667

666668
new ol.supermap.ChartService(url).queryChart(chartQueryParameters).then(function(res) {
667669
var queryRes = res.result.recordsets;
668670
queryResults.innerHTML = queryRes.length ? '': resources.text_queryEmpty;
669671
queryRes.forEach(function(recordset) {
670672
allFeatures.features.push(...recordset.features.features);
671673
recordset.features.features.forEach(function(feature) {
672-
var localName = featureInfos.find(function(featureInfo) {
673-
return featureInfo.acronym === feature.properties.Acronym;
674-
}).localName;
675674
var fea = (new ol.format.GeoJSON()).readFeature(feature);
676675
var type = feature.geometry.type;
677676
var feaGeometry = fea.getGeometry();

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