Skip to content

Commit 1532d42

Browse files
committed
fix ol编辑示例报错
1 parent 09d2fb4 commit 1532d42

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

examples/openlayers/drawAndEditFeatures.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -868,9 +868,8 @@ <h5><span data-i18n="resources.text_featureToDelete"></span>:</h5>
868868
var itemArr = Array.prototype.slice.call(item.children);
869869
properties[itemArr[0].textContent] = itemArr[1].value;
870870
});
871-
console.log('properties', properties);
872871
currentFeature.data.properties = properties;
873-
currentAddFeature.setProperties(properties);
872+
currentAddFeature && currentAddFeature.setProperties(properties);
874873
var olFeature = new ol.format.GeoJSON().readFeature(currentFeature.data);
875874
if (!olFeature.getId()) {
876875
datasetInfoList[currentDataset].uniqueId++;
@@ -884,7 +883,6 @@ <h5><span data-i18n="resources.text_featureToDelete"></span>:</h5>
884883
if (!properties['SMUSERID']) {
885884
olFeature.set('SMUSERID', olFeature.getId());
886885
}
887-
console.log('olFeature', olFeature);
888886
currentFeature.origin = olFeature;
889887
commit(isUpdate);
890888
switchPanel('edit', true);

0 commit comments

Comments
 (0)