(updated, selectfeatures)
| 115 | } |
| 116 | } |
| 117 | function updateSelectFeature(updated, selectfeatures) { |
| 118 | var transaction = new SuperMap.Plot.Transaction(); |
| 119 | L.supermap.plotting.getControl(this.map).getTransManager().add(transaction); |
| 120 | for (var i = 0; i < selectfeatures.length; i++) { |
| 121 | var transInfo = new SuperMap.Plot.TransactionInfo(); |
| 122 | transInfo.layerId = selectfeatures[i].layer._leaflet_id; |
| 123 | transInfo.uuid = selectfeatures[i].uuid; |
| 124 | if (updated != null) { |
| 125 | if (updated.group.includes(group[9])) { |
| 126 | //多注记 |
| 127 | var annotation = undefined; |
| 128 | let annotationIndex = updated.group.split(group[9])[1]; |
| 129 | if (annotationIndex > selectfeatures[i].getSymbolAnnotations().length && |
| 130 | updated.name == displayTextContentName[0]) { |
| 131 | annotation = new SuperMap.Plot.SymbolAnnotation(updated.value, 0, undefined, undefined); |
| 132 | selectfeatures[i].addSymbolAnnotations([annotation]); |
| 133 | } else { |
| 134 | if (updated.value == "" && updated.name == "注记内容") {//清空内容视为删除注记 |
| 135 | selectfeatures[i].removeSymbolAnnotation(annotationIndex - 1); |
| 136 | continue; |
| 137 | }else if(updated.value == ""){ |
| 138 | return; |
| 139 | } |
| 140 | annotation = selectfeatures[i].getSymbolAnnotation(annotationIndex - 1); |
| 141 | } |
| 142 | switch (updated.name) { |
| 143 | case displayTextContentName[0]: |
| 144 | transInfo.functionName = "textContent"; |
| 145 | transInfo.undoParams = [annotation.textContent]; |
| 146 | transInfo.redoParams = [updated.value]; |
| 147 | annotation.textContent = updated.value; |
| 148 | break; |
| 149 | case displayTextContentName[1]: |
| 150 | transInfo.functionName = "textPosition"; |
| 151 | transInfo.undoParams = [annotation.textPosition]; |
| 152 | transInfo.redoParams = [parseInt(updated.value)]; |
| 153 | annotation.textPosition = parseInt(updated.value); |
| 154 | break; |
| 155 | case displayTextContentName[2]: |
| 156 | transInfo.propertyName = "fontSize"; |
| 157 | transInfo.undoValue = annotation.style.fontSize; |
| 158 | transInfo.redoValue = parseFloat(updated.value); |
| 159 | annotation.setStyle({ fontSize: parseFloat(updated.value) }); |
| 160 | break; |
| 161 | case displayTextContentName[3]: |
| 162 | transInfo.propertyName = "fontColor"; |
| 163 | transInfo.undoValue = annotation.style.fontColor; |
| 164 | transInfo.redoValue = updated.value; |
| 165 | annotation.setStyle({ fontColor: updated.value }); |
| 166 | break; |
| 167 | case displayTextContentName[4]: |
| 168 | transInfo.propertyName = "fontFamily"; |
| 169 | transInfo.undoValue = annotation.style.fontFamily; |
| 170 | transInfo.redoValue = updated.value; |
| 171 | annotation.setStyle({ fontFamily: updated.value }); |
| 172 | break; |
| 173 | case displayTextContentName[8]: |
| 174 | transInfo.propertyName = "fontStroke"; |
no test coverage detected