Skip to content

Commit d58cbe1

Browse files
committed
提交标绘产品demo和资源文件
1 parent 0c474b1 commit d58cbe1

File tree

10 files changed

+433
-617
lines changed

10 files changed

+433
-617
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[
2+
"sign1_图片背景.html",
3+
"sign2_多行文字_无边框.html",
4+
"sign3_blue_单行文字.html",
5+
"sign4_Red_单行文字.html",
6+
"sign5_多行文字.html",
7+
"sign6_多行文字1.html",
8+
"sign7_图片背景1.html",
9+
"sign8_图片背景2.html",
10+
"sign9_图片背景3.html",
11+
"sign10_图片背景4.html",
12+
"sign11_图片背景5.html",
13+
"sign12_图片背景6.html"
14+
]

examples/js/plottingPanel/StylePanel.js

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -176,25 +176,28 @@ function updateSelectFeature(updated, selectfeatures) {
176176
if (parseInt(updated.value) === 999) {
177177
openDialog(selectfeatures[i]);
178178
} else {
179-
if (parseInt(updated.value) == 5) {
180-
selectfeatures[i].setDashLine([0.3, 0.05]);
181-
} else if (parseInt(updated.value) == 6) {
182-
selectfeatures[i].setDashLine([0.23, 0.06]);
183-
}
184-
else if (parseInt(updated.value) == 7) {
185-
selectfeatures[i].setDashLine([0.16, 0.05]);
186-
}
187-
else if (parseInt(updated.value) == 8) {
188-
selectfeatures[i].setDashLine([0.14, 0.032]);
189-
} else if (parseInt(updated.value) == 0) {
190-
selectfeatures[i].setDashLine([]);
191-
} else if (parseInt(updated.value) == 888) {
192-
selectfeatures[i].setDashLine([0]);
193-
}
194-
if (selectfeatures[i].style.lineSymbolID == 888) {
195-
selectfeatures[i].setDashLine([]);
196-
selectfeatures[i].setStyle({ lineSymbolID: 0 });
179+
if(selectfeatures[i].symbolType != 1){
180+
if (parseInt(updated.value) == 5) {
181+
selectfeatures[i].setDashLine([0.3, 0.05]);
182+
} else if (parseInt(updated.value) == 6) {
183+
selectfeatures[i].setDashLine([0.23, 0.06]);
184+
}
185+
else if (parseInt(updated.value) == 7) {
186+
selectfeatures[i].setDashLine([0.16, 0.05]);
187+
}
188+
else if (parseInt(updated.value) == 8) {
189+
selectfeatures[i].setDashLine([0.14, 0.032]);
190+
} else if (parseInt(updated.value) == 0) {
191+
selectfeatures[i].setDashLine([]);
192+
} else if (parseInt(updated.value) == 888) {
193+
selectfeatures[i].setDashLine([0]);
194+
}
195+
if (selectfeatures[i].style.lineSymbolID == 888) {
196+
selectfeatures[i].setDashLine([]);
197+
selectfeatures[i].setStyle({ lineSymbolID: 0 });
198+
}
197199
}
200+
198201
selectfeatures[i].setStyle({ lineSymbolID: updated.value });
199202
}
200203
// this.dashLines = [0.3,0.05];两段虚线
-11.5 KB
Loading
1.63 KB
Loading

examples/leaflet/plot_drawSpecialEffect.html

Lines changed: 33 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,19 @@
8787
<input type="button" id="playorpauseAllSpecialEffect" class="btn btn-default" style="width:100px;height:30px;padding: 0px;margin-top: 17px;
8888
margin-left: 10px;" data-i18n="[value]resources.text_pauseAllSpecialEffect"
8989
onclick="playorpauseAllSpecialEffect()" /> &nbsp;&nbsp;&nbsp;&nbsp;
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()" />
9093
</div>
9194
<div class="panel02" id="create&delete"
9295
style="display:flex; flex-direction: column;padding: 10px;padding-bottom: 0px;">
9396
<input type="button" class="btn btn-default" style="width:100px;height:30px;padding: 0px;"
9497
data-i18n="[value]resources.text_createSpecialEffect" onclick="create()" /> &nbsp;&nbsp;&nbsp;&nbsp;
9598
<input type="button" class="btn btn-default" style="width:100px;height:30px;padding: 0px;"
9699
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()" />
97103
&nbsp;&nbsp;&nbsp;&nbsp;
98104
</div>
99105
</div>
@@ -109,38 +115,6 @@
109115
</div>
110116
</div>
111117
</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-
&nbsp;&nbsp;&nbsp;&nbsp;
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-
&nbsp;&nbsp;&nbsp;&nbsp;
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-
&nbsp;&nbsp;&nbsp;&nbsp;
141-
</div>
142-
</div>
143-
</div>
144118
<div id="plottingMenu" class="plotting-menu">
145119
<li>
146120
<span class="icon iconfont icon-quanxuan" data-i18n="[title]resources.title_rectselect"
@@ -175,15 +149,13 @@
175149
var plotting = L.supermap.plotting.getControl(map, serverUrl);
176150
var plotMapManager = plotting.getPlotMapManager();
177151
var specialEffectManager = plotting.getSpecialEffectManager();
178-
L.supermap.plotting.initSpecialEffectTreePanel("specialEffectTree", specialEffectManager);
179152
L.supermap.plotting.initSpecialEffectStylePanel("specialEffectStylePanel", specialEffectManager);
180153
L.supermap.plotting.initStylePanel("stylePanel", serverUrl, editControl);
181154

182155

183156
var selectedSpecialEffectUuid, currentPoint, allIsPlay = false, selectedSpecialEffect;
184157
specialEffectManager.on(SuperMap.Plot.Event.specialeffectselected, function (event) {
185158

186-
// document.getElementById("connectordisconnect").disabled = false;
187159
document.getElementById("playorpause").disabled = false;
188160
document.getElementById("removeSelectSpecialEffect").disabled = false;
189161

@@ -206,20 +178,9 @@
206178
}
207179
tree.selectNode(node);
208180

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-
215181
});
216182
specialEffectManager.on(SuperMap.Plot.Event.specialeffectunselected, function (event) {
217183
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;
223184
document.getElementById("playorpause").disabled = true;
224185
document.getElementById("removeSelectSpecialEffect").disabled = true;
225186

@@ -235,7 +196,7 @@
235196
plotMapManager.loadFrom(JSON.parse(reader.result));
236197
drawControl.setDrawingLayer(plotMapManager.getActivePlottingLayer());
237198
plottingLayer = plotMapManager.getActivePlottingLayer();
238-
L.supermap.plotting.initSpecialEffectTreePanel("specialEffectTree", specialEffectManager);
199+
// L.supermap.plotting.initSpecialEffectTreePanel("specialEffectTree", specialEffectManager);
239200
}
240201
});
241202
function create() {
@@ -269,28 +230,33 @@
269230
}
270231
function createScanRadar() {
271232
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-
// }
276233
for (var i = 0; i < editControl.getSelectedFeatures().length; i++) {
277234
var feature = editControl.getSelectedFeatures()[i];
278-
// var options = new SuperMap.Plot.ScanRadar({});
279-
// var options = {loop : false};
280235
var style = {
281236
centerStyle: { fillColor: "#0000ff", fillOpacity: 0.51, color: "#00ff00", opacity: 1 }
282237
, circleStyle: { fillColor: "#00ff00", fillOpacity: 0.1, color: "#0000ff", opacity: 0.51 }
283238
, scanStyle: { fillColor: "#0fff00", fillOpacity: 0.5 }
284239
};
285240

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 };
287242
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);
288254
}
289255

290256
} else {
291257
var latlng = L.latLng(35.5, 103.84);
292258
specialEffectManager.createScanRadarByPosition(latlng, {});
293-
alert("当前在默认位置创建雷达,可使用绑定功能或选中标号后创建,从而与标号绑定!");
259+
alert("当前在默认位置创建雷达!");
294260
}
295261
}
296262
function createSectorDetectionRange() {
@@ -304,7 +270,7 @@
304270
} else {
305271
var latlng = L.latLng(39.5, 87.84);
306272
specialEffectManager.createSectorDetectionRangeByPosition(latlng, -90, {});
307-
alert("当前在默认位置创建扇形扫描,可使用绑定功能或选中标号后创建,从而与标号绑定!");
273+
alert("当前在默认位置创建扇形扫描!");
308274
}
309275
}
310276
function createBoom() {
@@ -318,7 +284,7 @@
318284
} else {
319285
var latlng = L.latLng(32.5, 118.84);
320286
specialEffectManager.createBoomByPosition(latlng, {});
321-
alert("当前在默认位置创建爆炸,可使用绑定功能或选中标号后创建,从而与标号绑定!");
287+
alert("当前在默认位置创建爆炸!");
322288
}
323289
}
324290
function createDestroy() {
@@ -349,7 +315,7 @@
349315
var aimLatlng = L.latLng(24.5, 102.84);
350316
specialEffectManager.createAimByPosition(viewLatlng, aimLatlng, {});
351317

352-
alert("当前在默认位置创建瞄准特效,可使用绑定功能或选中两个标号作为观察点与瞄准点后创建,从而与标号绑定!");
318+
alert("当前在默认位置创建瞄准特效!");
353319
}
354320
}
355321
function createCommunicationLink() {
@@ -367,43 +333,9 @@
367333
var sendLatlng = L.latLng(40.30, 111.91);
368334
var receiverLatlng = L.latLng(30.5, 114.84);
369335
specialEffectManager.createCommunicationLinkByPosition(sendLatlng, receiverLatlng, {});
370-
alert("当前在默认位置创建通讯链路,可使用绑定功能或选中两个标号作为发送信号与接收信号后创建,从而与标号绑定!");
336+
alert("当前在默认位置创建通讯链路!");
371337
}
372338
}
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-
// }
407339
function removeSelectFeature() {
408340
if (selectedSpecialEffectUuid) {
409341
specialEffectManager.fire(SuperMap.Plot.Event.specialeffectunselected, { specialEffect: selectedSpecialEffect });
@@ -416,20 +348,6 @@
416348
}
417349
}
418350
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 {
433351
var specialEffectList = specialEffectManager.getSpecialEffectList();
434352
for (var i = 0; i < specialEffectList.length; i++) {
435353
specialEffectManager.removeSpecialEffect(specialEffectList[i].uuid);
@@ -519,15 +437,15 @@
519437
if (selectedSpecialEffectUuid && selectedSpecialEffect) {
520438
// var effect = specialEffectManager.getSpecialEffectByUuid(selectedSpecialEffectUuid);
521439
// 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+
// }
531449
}
532450
}
533451
function openPlotMap() {

0 commit comments

Comments
 (0)