|
87 | 87 | <input type="button" id="playorpauseAllSpecialEffect" class="btn btn-default" style="width:100px;height:30px;padding: 0px;margin-top: 17px;
|
88 | 88 | margin-left: 10px;" data-i18n="[value]resources.text_pauseAllSpecialEffect"
|
89 | 89 | onclick="playorpauseAllSpecialEffect()" />
|
| 90 | + <input disabled="true" type="button" id="playorpause" class="btn btn-default" |
| 91 | + style="width:100px;height:30px;padding: 0px;margin-left: 11px;" |
| 92 | + data-i18n="[value]resources.text_playSelectedEffect" onclick="playOrPauseSelectFeature()" /> |
90 | 93 | </div>
|
91 | 94 | <div class="panel02" id="create&delete"
|
92 | 95 | style="display:flex; flex-direction: column;padding: 10px;padding-bottom: 0px;">
|
93 | 96 | <input type="button" class="btn btn-default" style="width:100px;height:30px;padding: 0px;"
|
94 | 97 | data-i18n="[value]resources.text_createSpecialEffect" onclick="create()" />
|
95 | 98 | <input type="button" class="btn btn-default" style="width:100px;height:30px;padding: 0px;"
|
96 | 99 | data-i18n="[value]resources.text_removeAllSpecialEffect" onclick="remove()" />
|
| 100 | + <input disabled="true" id="removeSelectSpecialEffect" type="button" class="btn btn-default" |
| 101 | + style="width:100px;height:30px;padding: 0px;margin-top: 17px;" data-i18n="[value]resources.text_removeSelectedEffect" |
| 102 | + onclick="removeSelectFeature()" /> |
97 | 103 |
|
98 | 104 | </div>
|
99 | 105 | </div>
|
|
109 | 115 | </div>
|
110 | 116 | </div>
|
111 | 117 | </div>
|
112 |
| - <div id="popupWin" class="panel panel-primary popupWindow" |
113 |
| - style=" position: absolute;right: 10px;top: 265px;width: 300px;background: #FFF;z-index: 9999;display: block;"> |
114 |
| - <div class="winTitle" style=" background: #1E90FF;"> |
115 |
| - <span class="title_left" data-i18n="resources.title_specialEffectTree"></span> |
116 |
| - </div> |
117 |
| - <div id="specialEffectTree" class="winContent" style=" padding: 5px;overflow-y: auto;height: 400px;"></div> |
118 |
| - <div class="treePanel"> |
119 |
| - <!-- <div class="panel01" id="selectPointType" style="display: contents;flex-direction: column;padding: 10px;"> |
120 |
| - <select id="pointType" style="width:100px;height:30px; margin-left:40px; margin-right:12px" |
121 |
| - disabled="true" onchange="changeConnectType(event)"> |
122 |
| - <option style="display: block;" id="unselect" data-i18n="resources.option_pleaseCheck" value="-1"></option> |
123 |
| - <option style="display: none;" id="viewPoint" data-i18n="resources.option_viewPoint" value="0"></option> |
124 |
| - <option style="display: none;" id="aimPoint" data-i18n="resources.option_aimPoint" value="1"></option> |
125 |
| - <option style="display: none;" id="senderPoint" data-i18n="resources.option_senderPoint" value="2"></option> |
126 |
| - <option style="display: none;" id="receiverPoint" data-i18n="resources.option_receiverPoint" value="3"></option> |
127 |
| - </select> |
128 |
| - <input disabled="true" type="button" id="connectordisconnect" class="btn btn-default" |
129 |
| - style="width:100px;height:30px;padding: 0px;" data-i18n="[value]resources.text_bindSymbol" onclick="connectordisconnect()" /> |
130 |
| - |
131 |
| - </div> --> |
132 |
| - <div class="panel1" id="play&remove" style="display:flex; padding: 10px;justify-content: center"> |
133 |
| - <input disabled="true" type="button" id="playorpause" class="btn btn-default" |
134 |
| - style="width:100px;height:30px;padding: 0px;margin-left: 11px;" |
135 |
| - data-i18n="[value]resources.text_playSelectedEffect" onclick="playOrPauseSelectFeature()" /> |
136 |
| - |
137 |
| - <input disabled="true" id="removeSelectSpecialEffect" type="button" class="btn btn-default" |
138 |
| - style="width:100px;height:30px;padding: 0px;" data-i18n="[value]resources.text_removeSelectedEffect" |
139 |
| - onclick="removeSelectFeature()" /> |
140 |
| - |
141 |
| - </div> |
142 |
| - </div> |
143 |
| - </div> |
144 | 118 | <div id="plottingMenu" class="plotting-menu">
|
145 | 119 | <li>
|
146 | 120 | <span class="icon iconfont icon-quanxuan" data-i18n="[title]resources.title_rectselect"
|
|
175 | 149 | var plotting = L.supermap.plotting.getControl(map, serverUrl);
|
176 | 150 | var plotMapManager = plotting.getPlotMapManager();
|
177 | 151 | var specialEffectManager = plotting.getSpecialEffectManager();
|
178 |
| - L.supermap.plotting.initSpecialEffectTreePanel("specialEffectTree", specialEffectManager); |
179 | 152 | L.supermap.plotting.initSpecialEffectStylePanel("specialEffectStylePanel", specialEffectManager);
|
180 | 153 | L.supermap.plotting.initStylePanel("stylePanel", serverUrl, editControl);
|
181 | 154 |
|
182 | 155 |
|
183 | 156 | var selectedSpecialEffectUuid, currentPoint, allIsPlay = false, selectedSpecialEffect;
|
184 | 157 | specialEffectManager.on(SuperMap.Plot.Event.specialeffectselected, function (event) {
|
185 | 158 |
|
186 |
| - // document.getElementById("connectordisconnect").disabled = false; |
187 | 159 | document.getElementById("playorpause").disabled = false;
|
188 | 160 | document.getElementById("removeSelectSpecialEffect").disabled = false;
|
189 | 161 |
|
|
206 | 178 | }
|
207 | 179 | tree.selectNode(node);
|
208 | 180 |
|
209 |
| - // if (type == SuperMap.Plot.SpecialEffectType.AIM) { |
210 |
| - // selectPointType.value = "0"; |
211 |
| - // } else if (type == SuperMap.Plot.SpecialEffectType.COMMUNICATIONLINK) { |
212 |
| - // selectPointType.value = "2"; |
213 |
| - // } |
214 |
| - |
215 | 181 | });
|
216 | 182 | specialEffectManager.on(SuperMap.Plot.Event.specialeffectunselected, function (event) {
|
217 | 183 | document.getElementById("playorpause").value = resources.text_playSelectedEffect;
|
218 |
| - // document.getElementById("connectordisconnect").value = resources.text_bindSymbol; |
219 |
| - |
220 |
| - // document.getElementById("pointType").value = "-1"; |
221 |
| - // document.getElementById("pointType").disabled = true; |
222 |
| - // document.getElementById("connectordisconnect").disabled = true; |
223 | 184 | document.getElementById("playorpause").disabled = true;
|
224 | 185 | document.getElementById("removeSelectSpecialEffect").disabled = true;
|
225 | 186 |
|
|
235 | 196 | plotMapManager.loadFrom(JSON.parse(reader.result));
|
236 | 197 | drawControl.setDrawingLayer(plotMapManager.getActivePlottingLayer());
|
237 | 198 | plottingLayer = plotMapManager.getActivePlottingLayer();
|
238 |
| - L.supermap.plotting.initSpecialEffectTreePanel("specialEffectTree", specialEffectManager); |
| 199 | + // L.supermap.plotting.initSpecialEffectTreePanel("specialEffectTree", specialEffectManager); |
239 | 200 | }
|
240 | 201 | });
|
241 | 202 | function create() {
|
|
269 | 230 | }
|
270 | 231 | function createScanRadar() {
|
271 | 232 | if (editControl.getSelectedFeatures().length != 0) {
|
272 |
| - // for (var i = 0; i < editControl.getSelectedFeatures().length; i++) { |
273 |
| - // var feature = editControl.getSelectedFeatures()[i]; |
274 |
| - // specialEffectManager.createScanRadar(feature.uuid, {}); |
275 |
| - // } |
276 | 233 | for (var i = 0; i < editControl.getSelectedFeatures().length; i++) {
|
277 | 234 | var feature = editControl.getSelectedFeatures()[i];
|
278 |
| - // var options = new SuperMap.Plot.ScanRadar({}); |
279 |
| - // var options = {loop : false}; |
280 | 235 | var style = {
|
281 | 236 | centerStyle: { fillColor: "#0000ff", fillOpacity: 0.51, color: "#00ff00", opacity: 1 }
|
282 | 237 | , circleStyle: { fillColor: "#00ff00", fillOpacity: 0.1, color: "#0000ff", opacity: 0.51 }
|
283 | 238 | , scanStyle: { fillColor: "#0fff00", fillOpacity: 0.5 }
|
284 | 239 | };
|
285 | 240 |
|
286 |
| - var options = { period: 1, startAngle: 0, loop: false, radius: 50, style: style }; |
| 241 | + var options = { period: 1, startAngle: 0, loop: true, radius: 50, style: style }; |
287 | 242 | var effectObj = new L.supermap.plotting.ScanRadar(feature.uuid, null, options);
|
| 243 | + |
| 244 | + //另一种创建方式,与点标号一起创建, 将雷达数据结构(SuperMap.Plot.ScanRadar({}))传入点标号的options.specialEffects参数中 |
| 245 | + //var dotSymbol = L.supermap.plotting.PlottingObject.createSymbol( |
| 246 | + // 421, randomCode[randomIndex], L.latLng( |
| 247 | + // coordinates[0], coordinates[1]), { |
| 248 | + // serverUrl: serverUrl, |
| 249 | + // symbolData: randomSymbolData[randomIndex], |
| 250 | + // symbolSize: new SuperMap.Size(20, 20), |
| 251 | + // specialEffects: [new SuperMap.Plot.ScanRadar({})], |
| 252 | + // trajectory: new SuperMap.Plot.Trajectory(10, true, false, {color: "#00ff00"}, {saveTrackingPoint: true}) |
| 253 | + // }, null, null); |
288 | 254 | }
|
289 | 255 |
|
290 | 256 | } else {
|
291 | 257 | var latlng = L.latLng(35.5, 103.84);
|
292 | 258 | specialEffectManager.createScanRadarByPosition(latlng, {});
|
293 |
| - alert("当前在默认位置创建雷达,可使用绑定功能或选中标号后创建,从而与标号绑定!"); |
| 259 | + alert("当前在默认位置创建雷达!"); |
294 | 260 | }
|
295 | 261 | }
|
296 | 262 | function createSectorDetectionRange() {
|
|
304 | 270 | } else {
|
305 | 271 | var latlng = L.latLng(39.5, 87.84);
|
306 | 272 | specialEffectManager.createSectorDetectionRangeByPosition(latlng, -90, {});
|
307 |
| - alert("当前在默认位置创建扇形扫描,可使用绑定功能或选中标号后创建,从而与标号绑定!"); |
| 273 | + alert("当前在默认位置创建扇形扫描!"); |
308 | 274 | }
|
309 | 275 | }
|
310 | 276 | function createBoom() {
|
|
318 | 284 | } else {
|
319 | 285 | var latlng = L.latLng(32.5, 118.84);
|
320 | 286 | specialEffectManager.createBoomByPosition(latlng, {});
|
321 |
| - alert("当前在默认位置创建爆炸,可使用绑定功能或选中标号后创建,从而与标号绑定!"); |
| 287 | + alert("当前在默认位置创建爆炸!"); |
322 | 288 | }
|
323 | 289 | }
|
324 | 290 | function createDestroy() {
|
|
349 | 315 | var aimLatlng = L.latLng(24.5, 102.84);
|
350 | 316 | specialEffectManager.createAimByPosition(viewLatlng, aimLatlng, {});
|
351 | 317 |
|
352 |
| - alert("当前在默认位置创建瞄准特效,可使用绑定功能或选中两个标号作为观察点与瞄准点后创建,从而与标号绑定!"); |
| 318 | + alert("当前在默认位置创建瞄准特效!"); |
353 | 319 | }
|
354 | 320 | }
|
355 | 321 | function createCommunicationLink() {
|
|
367 | 333 | var sendLatlng = L.latLng(40.30, 111.91);
|
368 | 334 | var receiverLatlng = L.latLng(30.5, 114.84);
|
369 | 335 | specialEffectManager.createCommunicationLinkByPosition(sendLatlng, receiverLatlng, {});
|
370 |
| - alert("当前在默认位置创建通讯链路,可使用绑定功能或选中两个标号作为发送信号与接收信号后创建,从而与标号绑定!"); |
| 336 | + alert("当前在默认位置创建通讯链路!"); |
371 | 337 | }
|
372 | 338 | }
|
373 |
| - // function changeConnectType(event) { |
374 |
| - // var effect = specialEffectManager.getSpecialEffectByUuid(selectedSpecialEffectUuid); |
375 |
| - // if (effect == null) { |
376 |
| - // return; |
377 |
| - // } |
378 |
| - // switch (event.target.value) { |
379 |
| - // case '0': |
380 |
| - // currentPoint = "viewPoint"; |
381 |
| - // this.checkIsConnectedToFeature(effect.viewUuid); |
382 |
| - // break; |
383 |
| - // case '1': |
384 |
| - // currentPoint = "aimPoint"; |
385 |
| - // this.checkIsConnectedToFeature(effect.aimUuid); |
386 |
| - // break; |
387 |
| - // case '2': |
388 |
| - // currentPoint = "senderPoint"; |
389 |
| - // this.checkIsConnectedToFeature(effect.senderUuid); |
390 |
| - // break; |
391 |
| - // case '3': |
392 |
| - // currentPoint = "receiverPoint"; |
393 |
| - // this.checkIsConnectedToFeature(effect.receiverUuid); |
394 |
| - // break; |
395 |
| - |
396 |
| - // default: |
397 |
| - // break; |
398 |
| - // } |
399 |
| - // } |
400 |
| - // function checkIsConnectedToFeature(uuid) { |
401 |
| - // if (uuid) { |
402 |
| - // document.getElementById("connectordisconnect").value = resources.text_unbindSymbol; |
403 |
| - // } else { |
404 |
| - // document.getElementById("connectordisconnect").value = resources.text_bindSymbol; |
405 |
| - // } |
406 |
| - // } |
407 | 339 | function removeSelectFeature() {
|
408 | 340 | if (selectedSpecialEffectUuid) {
|
409 | 341 | specialEffectManager.fire(SuperMap.Plot.Event.specialeffectunselected, { specialEffect: selectedSpecialEffect });
|
|
416 | 348 | }
|
417 | 349 | }
|
418 | 350 | function remove() {
|
419 |
| - // if (editControl.getSelectedFeatures().length > 0) { |
420 |
| - // for (var j = 0; j < editControl.getSelectedFeatures().length; j++) { |
421 |
| - // var feature = editControl.getSelectedFeatures()[j]; |
422 |
| - // var specialEffectListByFeature = feature.getSpecialEffects(); |
423 |
| - // var effectMap = new Map(); |
424 |
| - // for (var n = 0; n < specialEffectListByFeature.length; n++) { |
425 |
| - // effectMap.set(specialEffectListByFeature[n].uuid, specialEffectListByFeature[n]); |
426 |
| - // } |
427 |
| - // for (var key of effectMap.keys()) { |
428 |
| - // specialEffectManager.fire(SuperMap.Plot.Event.specialeffectunselected, { specialEffect: effectMap.get(key) }); |
429 |
| - // effectMap.get(key).remove(); |
430 |
| - // } |
431 |
| - // } |
432 |
| - // } else { |
433 | 351 | var specialEffectList = specialEffectManager.getSpecialEffectList();
|
434 | 352 | for (var i = 0; i < specialEffectList.length; i++) {
|
435 | 353 | specialEffectManager.removeSpecialEffect(specialEffectList[i].uuid);
|
|
519 | 437 | if (selectedSpecialEffectUuid && selectedSpecialEffect) {
|
520 | 438 | // var effect = specialEffectManager.getSpecialEffectByUuid(selectedSpecialEffectUuid);
|
521 | 439 | // effect.pause();
|
522 |
| - // selectedSpecialEffect.pause(); |
523 |
| - for (var i = 0; i < plottingLayer.features.length; i++) { |
524 |
| - var effects = plottingLayer.features[i].getSpecialEffects(); |
525 |
| - for (var j = 0; j < effects.length; j++) { |
526 |
| - if (effects[j].uuid == selectedSpecialEffectUuid) { |
527 |
| - effects[j].pause(); |
528 |
| - } |
529 |
| - } |
530 |
| - } |
| 440 | + selectedSpecialEffect.pause(); |
| 441 | + // for (var i = 0; i < plottingLayer.features.length; i++) { |
| 442 | + // var effects = plottingLayer.features[i].getSpecialEffects(); |
| 443 | + // for (var j = 0; j < effects.length; j++) { |
| 444 | + // if (effects[j].uuid == selectedSpecialEffectUuid) { |
| 445 | + // effects[j].pause(); |
| 446 | + // } |
| 447 | + // } |
| 448 | + // } |
531 | 449 | }
|
532 | 450 | }
|
533 | 451 | function openPlotMap() {
|
|
0 commit comments