diff --git a/examples/leaflet/plot_drawSpecialEffect.html b/examples/leaflet/plot_drawSpecialEffect.html index 0765a9a20..fd9ef6780 100644 --- a/examples/leaflet/plot_drawSpecialEffect.html +++ b/examples/leaflet/plot_drawSpecialEffect.html @@ -76,23 +76,23 @@
     + margin-left: 10px;" data-i18n="[value]resources.text_pauseAllSpecialEffect" onclick="playorpauseAllSpecialEffect()" />     
-           + data-i18n="[value]resources.text_removeAllSpecialEffect" onclick="remove()" />     
@@ -117,29 +117,29 @@
+ style="width:100px;height:30px;padding: 0px;" data-i18n="[value]resources.text_bindSymbol" onclick="connectordisconnect()" />     
+ style="width:100px;height:30px;padding: 0px;margin-left: 11px;" data-i18n="[value]resources.text_playSelectedEffect" onclick="playOrPauseSelectFeature()" />      + style="width:100px;height:30px;padding: 0px;" data-i18n="[value]resources.text_removeSelectedEffect" onclick="removeSelectFeature()" />     
  • - +
  • @@ -162,7 +162,7 @@ }); var baseLayer = L.supermap.tiledMapLayer(url).addTo(map); L.control.scale().addTo(map); - var plottingLayer = L.supermap.plotting.plottingLayer("标绘图层", serverUrl).addTo(map); + var plottingLayer = L.supermap.plotting.plottingLayer("plottingLayer", serverUrl).addTo(map); var drawControl = L.supermap.plotting.drawControl(plottingLayer).addTo(map); var editControl = L.supermap.plotting.editControl().addTo(map); L.supermap.plotting.initPlotPanel("plotPanel", serverUrl, drawControl); @@ -183,9 +183,9 @@ document.getElementById("removeSelectSpecialEffect").disabled = false; if (event.specialEffect.isPlay) { - document.getElementById("playorpause").value = "暂停选中特效"; + document.getElementById("playorpause").value = resources.text_pauseSelectedEffect; } else { - document.getElementById("playorpause").value = "播放选中特效"; + document.getElementById("playorpause").value = resources.text_playSelectedEffect; } selectedSpecialEffectUuid = event.specialEffect.uuid; var type = event.specialEffect.getType(); @@ -201,15 +201,15 @@ document.getElementById("receiverPoint").style.display = "none"; if ((selectPointType.value == "0" || selectPointType.value == "-1") && event.specialEffect.viewUuid) { - document.getElementById("connectordisconnect").value = "解绑标号"; + document.getElementById("connectordisconnect").value = resources.text_unbindSymbol; } else if (selectPointType.value == "0" && !event.specialEffect.viewUuid) { - document.getElementById("connectordisconnect").value = "绑定标号"; + document.getElementById("connectordisconnect").value = resources.text_bindSymbol; } if (selectPointType.value == "1" && event.specialEffect.aimUuid) { - document.getElementById("connectordisconnect").value = "解绑标号"; + document.getElementById("connectordisconnect").value = resources.text_unbindSymbol; } else if (selectPointType.value == "1" && !event.specialEffect.aimUuid) { - document.getElementById("connectordisconnect").value = "绑定标号"; + document.getElementById("connectordisconnect").value = resources.text_bindSymbol; } } else if (type == SuperMap.Plot.SpecialEffectType.COMMUNICATIONLINK) { selectPointType.disabled = false; @@ -222,15 +222,15 @@ selectPointType.value = "2"; if (selectPointType.value == "2" && event.specialEffect.senderUuid) { - document.getElementById("connectordisconnect").value = "解绑标号"; + document.getElementById("connectordisconnect").value = resources.text_unbindSymbol; } else if (selectPointType.value == "2" && !event.specialEffect.senderUuid) { - document.getElementById("connectordisconnect").value = "绑定标号"; + document.getElementById("connectordisconnect").value = resources.text_bindSymbol; } if (selectPointType.value == "3" && event.specialEffect.receiverUuid) { - document.getElementById("connectordisconnect").value = "解绑标号"; + document.getElementById("connectordisconnect").value = resources.text_unbindSymbol; } else if (selectPointType.value == "3" && !event.specialEffect.receiverUuid) { - document.getElementById("connectordisconnect").value = "绑定标号"; + document.getElementById("connectordisconnect").value = resources.text_bindSymbol; } } else { selectPointType.value = "-1"; @@ -243,9 +243,9 @@ document.getElementById("receiverPoint").style.display = "none" if (event.specialEffect.associatedUuid) { - document.getElementById("connectordisconnect").value = "解绑标号"; + document.getElementById("connectordisconnect").value = resources.text_unbindSymbol; } else if (!event.specialEffect.associatedUuid) { - document.getElementById("connectordisconnect").value = "绑定标号"; + document.getElementById("connectordisconnect").value = resources.text_bindSymbol; } } @@ -267,8 +267,8 @@ }); specialEffectManager.on(SuperMap.Plot.Event.specialeffectunselected, function (event) { - document.getElementById("playorpause").value = "播放选中特效"; - document.getElementById("connectordisconnect").value = "绑定标号"; + document.getElementById("playorpause").value = resources.text_playSelectedEffect; + document.getElementById("connectordisconnect").value = resources.text_bindSymbol; document.getElementById("pointType").value = "-1"; document.getElementById("pointType").disabled = true; @@ -425,9 +425,9 @@ } function checkIsConnectedToFeature(uuid) { if (uuid) { - document.getElementById("connectordisconnect").value = "解绑标号"; + document.getElementById("connectordisconnect").value = resources.text_unbindSymbol; } else { - document.getElementById("connectordisconnect").value = "绑定标号"; + document.getElementById("connectordisconnect").value = resources.text_bindSymbol; } } function removeSelectFeature() { @@ -461,11 +461,11 @@ } function playorpauseAllSpecialEffect() { if (allIsPlay == true) { - document.getElementById("playorpauseAllSpecialEffect").value = "暂停所有特效"; + document.getElementById("playorpauseAllSpecialEffect").value = resources.text_pauseAllSpecialEffect; this.palyAllSpecialEffect(); allIsPlay = false; } else { - document.getElementById("playorpauseAllSpecialEffect").value = "播放所有特效"; + document.getElementById("playorpauseAllSpecialEffect").value = resources.text_playAllSpecialEffect; this.pauseAllSpecialEffect(); allIsPlay = true; } @@ -484,12 +484,12 @@ } function connectordisconnect() { - if (document.getElementById("connectordisconnect").value == "绑定标号") { + if (document.getElementById("connectordisconnect").value == resources.text_bindSymbol) { this.bind(); - document.getElementById("connectordisconnect").value = "解绑标号"; + document.getElementById("connectordisconnect").value = resources.text_unbindSymbol; } else { this.disconnectionToFeature(); - document.getElementById("connectordisconnect").value = "绑定标号"; + document.getElementById("connectordisconnect").value = resources.text_bindSymbol; } } function bind() { @@ -591,12 +591,12 @@ } } function playOrPauseSelectFeature() { - if (document.getElementById("playorpause").value == "播放选中特效") { + if (document.getElementById("playorpause").value == resources.text_playSelectedEffect) { this.playSelectFeature(); - document.getElementById("playorpause").value = "暂停选中特效"; + document.getElementById("playorpause").value = resources.text_pauseSelectedEffect; } else { this.pauseSelectFeature(); - document.getElementById("playorpause").value = "播放选中特效" + document.getElementById("playorpause").value = resources.text_playSelectedEffect } } function playSelectFeature() { @@ -624,7 +624,7 @@ const objectURL = URL.createObjectURL(blob); const domElement = document.createElement("a"); domElement.href = objectURL; - domElement.download = "标绘图" + getFileTime(); + domElement.download = resources.title_plotMap + getFileTime(); domElement.click(); URL.revokeObjectURL(objectURL); } diff --git a/examples/leaflet/plot_drawSymbolGroup.html b/examples/leaflet/plot_drawSymbolGroup.html index b73cb0e71..5c08b4bb3 100644 --- a/examples/leaflet/plot_drawSymbolGroup.html +++ b/examples/leaflet/plot_drawSymbolGroup.html @@ -75,17 +75,17 @@
    - 标号|图片|模型 +
    - 个数 + - +
    @@ -96,22 +96,22 @@
    -
    -
    +
    +
    - 范围颜色 +
    - 信息背景颜色 +
    - 信息边界颜色 + @@ -146,7 +146,7 @@
    - @@ -164,7 +164,7 @@
  • - +
  • @@ -199,9 +199,12 @@ L.supermap.plotting.initPlotPanel("plotPanel", serverUrl, drawControl); L.supermap.plotting.initStylePanel("stylePanel", serverUrl, editControl); + diabledPropertyPanel(); + editControl.on("featuresselected", featuresSelected); editControl.on("featuresunselected", featuresUnselected); + featuresUnselected(); document.getElementById("plottingOpenMapFile").addEventListener('input', (evt) => { var file = evt.target.files; @@ -215,20 +218,37 @@ } }); document.getElementById("symbol").value = "0"; - currentSymbolType = "标号"; - document.getElementById("createOrUnSymbolGroup").value = "创建聚合对象" + currentSymbolType = resources.option_symbol; + document.getElementById("createOrUnSymbolGroup").value = resources.btn_createSymbolGroup; function featuresSelected() { var features = editControl.getSelectedFeatures(); + if (features.length == 1 && features[0].symbolType == 999) { + document.getElementById("rangeColor").disabled = false; + document.getElementById("fontBackgroundColor").disabled = false; + document.getElementById("fontBackgroundBorderColor").disabled = false; + document.getElementById("cp1").disabled = false; + document.getElementById("cp2").disabled = false; + document.getElementById("cp3").disabled = false; + $("#cp1").css("pointer-events", ""); + $("#cp2").css("pointer-events", ""); + $("#cp3").css("pointer-events", ""); + document.getElementById("culsterRangeVisible").disabled = false; + document.getElementById("onlyInCulsterRangeVisible").disabled = false; + document.getElementById("culsterInfoVisible").disabled = false; + document.getElementById("onlyInCulsterInfoVisible").disabled = false; + } else { + diabledPropertyPanel(); + } for (var i = 0; i < features.length; i++) { if (features[i].symbolType != 999) { - document.getElementById("createOrUnSymbolGroup").value = "创建聚合对象" + document.getElementById("createOrUnSymbolGroup").value = resources.btn_createSymbolGroup continue; } document.getElementById("rangeColor").value = features[i].style.rangeColor; document.getElementById("fontBackgroundColor").value = features[i].style.fontBackgroundColor; document.getElementById("fontBackgroundBorderColor").value = features[i].style.fontBackgroundBorderColor; - document.getElementById("createOrUnSymbolGroup").value = "解绑聚合对象"; + document.getElementById("createOrUnSymbolGroup").value = resources.btn_unSymbolGroup; if (features[i].showClusterRange) document.getElementById("culsterRangeVisible").value = 1; @@ -261,17 +281,35 @@ document.getElementById("culsterInfoVisible").value = 0; document.getElementById("onlyInCulsterInfoVisible").value = 0; + + diabledPropertyPanel(); + + } + function diabledPropertyPanel(){ + document.getElementById("rangeColor").disabled = true; + document.getElementById("fontBackgroundColor").disabled = true; + document.getElementById("fontBackgroundBorderColor").disabled = true; + document.getElementById("cp1").disabled = true; + document.getElementById("cp2").disabled = true; + document.getElementById("cp3").disabled = true; + $("#cp1").css("pointer-events", "none"); + $("#cp2").css("pointer-events", "none"); + $("#cp3").css("pointer-events", "none"); + document.getElementById("culsterRangeVisible").disabled = true; + document.getElementById("onlyInCulsterRangeVisible").disabled = true; + document.getElementById("culsterInfoVisible").disabled = true; + document.getElementById("onlyInCulsterInfoVisible").disabled = true; } function symbolChanged(event) { switch (event.target.value) { case '0': - currentSymbolType = "标号"; + currentSymbolType = resources.option_symbol; break; case '1': - currentSymbolType = "图片"; + currentSymbolType = resources.option_picture; break; case '2': - currentSymbolType = "模型"; + currentSymbolType = resources.option_model; break; default: @@ -310,17 +348,17 @@ options.path = "../img/Plane/Plane_1.png"; for (var i = 0; i < num; i++) { var latlngs = [new L.latLng(map.getCenter().lat + (2 * e * Math.random() - e), map.getCenter().lng + (2 * e * Math.random() - e))]; - // plottingLayer.createSymbol(libID, code, latlngs, "", {}, options); + // plottingLayer.createSymbol(libID, code, latlngs, "", {}, options); plottingLayer.createSymbol(libID, code, latlngs); } } function drawGraphics() { plottingLayer.removeAllFeatures(); - if (currentSymbolType === "标号") { + if (currentSymbolType === resources.option_symbol) { this.createRoomNumber(); - } else if (currentSymbolType === "模型") { + } else if (currentSymbolType === resources.option_model) { this.createAirPlane(); - } else if (currentSymbolType === "图片") { + } else if (currentSymbolType === resources.option_picture) { this.createPicture(); } } @@ -330,6 +368,10 @@ function setCulsterRangeVisible() { var features = editControl.getSelectedFeatures(); + if (features.length == 0) { + alert("请选择要修改的聚合对象"); + return; + } if (features[0].symbolType != 999) { return; } @@ -351,6 +393,10 @@ function setCulsterInfoVisible() { var features = editControl.getSelectedFeatures(); + if (features.length == 0) { + alert("请选择要修改的聚合对象"); + return; + } if (features[0].symbolType != 999) { return; } @@ -371,7 +417,7 @@ } function createOrUnSymbolGroup() { - if (document.getElementById("createOrUnSymbolGroup").value == "创建聚合对象") { + if (document.getElementById("createOrUnSymbolGroup").value == resources.btn_createSymbolGroup) { var features = editControl.getSelectedFeatures(); if (features.length == 0) { alert("请选择要聚合显示的标号"); @@ -399,7 +445,7 @@ plottingLayer.unGroupSymbol(features[i]); } } - document.getElementById("createOrUnSymbolGroup").value == "创建聚合对象" + document.getElementById("createOrUnSymbolGroup").value == resources.btn_createSymbolGroup } } @@ -437,7 +483,7 @@ const objectURL = URL.createObjectURL(blob); const domElement = document.createElement("a"); domElement.href = objectURL; - domElement.download = "标绘图" + getFileTime(); + domElement.download = resources.title_plotMap + getFileTime(); domElement.click(); URL.revokeObjectURL(objectURL); } @@ -467,7 +513,7 @@ $("#cp1").colorpicker({ ishex: true, fillcolor: true, - event: 'mouseover', + event: 'click', target: $("#rangeColor"), success: rangeColorChanges @@ -479,6 +525,10 @@ function rangeColorChanges() { var color = document.getElementById("rangeColor").value; var features = editControl.getSelectedFeatures(); + if (features.length == 0) { + alert("请选择要修改的聚合对象"); + return; + } features[0].setStyle({ rangeColor: color }); } @@ -486,7 +536,7 @@ $("#cp2").colorpicker({ ishex: true, fillcolor: true, - event: 'mouseover', + event: 'click', target: $("#fontBackgroundColor"), success: fontBackgroundColorChanges @@ -498,6 +548,10 @@ function fontBackgroundColorChanges() { var color = document.getElementById("fontBackgroundColor").value; var features = editControl.getSelectedFeatures(); + if (features.length == 0) { + alert("请选择要修改的聚合对象"); + return; + } features[0].setStyle({ fontBackgroundColor: color }); } @@ -505,7 +559,7 @@ $("#cp3").colorpicker({ ishex: true, fillcolor: true, - event: 'mouseover', + event: 'click', target: $("#fontBackgroundBorderColor"), success: fontBackgroundBorderColorChanges @@ -517,6 +571,10 @@ function fontBackgroundBorderColorChanges() { var color = document.getElementById("fontBackgroundBorderColor").value; var features = editControl.getSelectedFeatures(); + if (features.length == 0) { + alert("请选择要修改的聚合对象"); + return; + } features[0].setStyle({ fontBackgroundBorderColor: color }); } $(document).ready(function () { @@ -527,4 +585,4 @@ - + \ No newline at end of file diff --git a/examples/leaflet/plot_dynamicPlot.html b/examples/leaflet/plot_dynamicPlot.html index d2bdd5fd9..130f39c0d 100644 --- a/examples/leaflet/plot_dynamicPlot.html +++ b/examples/leaflet/plot_dynamicPlot.html @@ -1,5 +1,5 @@