Skip to content

Commit

Permalink
修改demo的中文本地化
Browse files Browse the repository at this point in the history
  • Loading branch information
hhyu1 committed Aug 2, 2018
1 parent 6f4ab58 commit cc82765
Show file tree
Hide file tree
Showing 23 changed files with 269 additions and 213 deletions.
4 changes: 2 additions & 2 deletions examples/classic/plot_dynamicPlot.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@
</ul>
</li>
<li>
<a class="glyphicon glyphicon-arrow-left notArrow" title="撤销"
<a class="glyphicon glyphicon-arrow-left notArrow" data-i18n="[title]resources.btn_undo"
onclick="undo()"></a>
</li>
<li>
<a class="glyphicon glyphicon-arrow-right notArrow" title="重做"
<a class="glyphicon glyphicon-arrow-right notArrow" data-i18n="[title]resources.btn_redo"
onclick="redo()"></a>
</li>
</div>
Expand Down
12 changes: 6 additions & 6 deletions examples/classic/plot_filetransfer.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,26 +63,26 @@ <h5 class='panel-title text-center' data-i18n="resources.title_filetransfer"></h
<div class='panel-body content' style="border-bottom-left-radius: 4px;border-bottom-right-radius: 4px">
<div class='input-group' style="margin-top: 15px;margin-left: 10px">
<input type="file" style='width:200px;float: left;' id="smlFile"
name="smlFile"/>
name="smlFile"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" class="btn btn-default" data-i18n="[value]resources.btn_upload"
onclick="uploadSmlFile()"/>
</div>
<div class='input-group' style="margin-left: 10px;">
<span class='input-group-addon' data-i18n="resources.text_failUrl"></span>
<input class='form-control' type="text" style='width:100px;' id="downloadUrl" name="downloadUrl"
<span class='input-group-addon' data-i18n="resources.text_fileUrl"></span>
<input class='form-control' type="text" style='width:200px;' id="downloadUrl" name="downloadUrl"
value=""/>
<input type="button" class="btn btn-default" data-i18n="[value]resources.btn_download"
onclick="downloadSmlFileOnServer()"/>
</div>
<div class='input-group' style="margin-left: 10px;margin-bottom: 15px">
<span class='input-group-addon' data-i18n="resources.text_failName"></span>
<input class='form-control' type="text" style='width:100px;' id="smlFileName" name="smlFileName"
<span class='input-group-addon' data-i18n="resources.text_fileName"></span>
<input class='form-control' type="text" style='width:200px;' id="smlFileName" name="smlFileName"
value=""/>
<input type="button" class="btn btn-default" data-i18n="[value]resources.text_input_value_delete" onclick="deleteSmlFileOnServer()"/>
</div>
</div>
</div>
<div id="filetree" data-i18n="[title]resources.text_failList"></div>
<div id="filetree" data-i18n="[title]resources.text_fileList"></div>
<div id="map"></div>
<script type="text/javascript" include="bootstrap" src="../js/include-web.js"></script>
<script type="text/javascript" exclude="iclient-classic" include="fileupLoad,PlottingPanel"
Expand Down
2 changes: 1 addition & 1 deletion examples/classic/plot_plotSymbolPerformance.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ <h5 class='panel-title text-center' data-i18n="resources.title_plotSymbolPerform
<span><h4 data-i18n="resources.text_performancePlottingLayer"></h4></span>
<div class='input-group'>
<input type="button" class="btn btn-default" data-i18n="[value]resources.btn_addDifferentPlot"
onclick="addSymboltoPlottingLayer(0,false)"/&nbsp;&nbsp;
onclick="addSymboltoPlottingLayer(0,false)"/>&nbsp;&nbsp;
<input type="button" class="btn btn-default" data-i18n="[value]resources.btn_addSamePlot"
onclick="addSymboltoPlottingLayer(1,false)"/>&nbsp;&nbsp;
<input type="button" class="btn btn-default" data-i18n="[value]resources.text_input_value_clear" onclick="clearSymbol()"/>
Expand Down
12 changes: 6 additions & 6 deletions examples/leaflet/plot_addfile.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
<div id="toolbar" class="panel panel-primary" style="position: absolute;top: 15px;right: 10px;text-align: center;z-index: 9999;border-radius: 4px;">
<div class='panel-heading'>
<h5 class='panel-title text-center'>态势图叠加</h5></div>
<h5 class='panel-title text-center' data-i18n="resources.title_addfile"></h5></div>
<div class='panel-body content'>
<div class='panel'>
<div class='input-group' style=" margin-bottom: 10px;">
<input type="file" id="file" name="file" style="margin-left: 50px">
<input type="file" id="file" name="file" style="margin-left: 50px"/>
</div>
</div>
<input type="button" class="btn btn-default" value="叠加" onclick="add()"/>
<input type="button" class="btn btn-default" value="叠加到指定图层" onclick="addtolayer()"/>
<input type="button" class="btn btn-default" value="打开并上传服务器" onclick="openFileToServer()"/>
<input type="button" class="btn btn-default" value="清除" onclick="clearLayers()"/>
<input type="button" class="btn btn-default" data-i18n="[value]resources.btn_overlay" onclick="add()"/>
<input type="button" class="btn btn-default" data-i18n="[value]resources.btn_addToLater" onclick="addtolayer()"/>
<input type="button" class="btn btn-default" data-i18n="[value]resources.btn_open" onclick="openFileToServer()"/>
<input type="button" class="btn btn-default" data-i18n="[value]resources.text_input_value_clear" onclick="clearLayers()"/>
</div>
</div>
<div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>
Expand Down
83 changes: 63 additions & 20 deletions examples/leaflet/plot_defaultStyle.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,48 +8,42 @@
<div id="toolbar" class="panel panel-primary"
style="position: absolute;top: 10px;right: 10px;width: 300px;text-align: center;z-index: 800;border-radius: 4px;">
<div class='panel-heading'>
<h5 class='panel-title text-center'>缺省属性</h5></div>
<h5 class='panel-title text-center' data-i18n="resources.title_defaultStyle"></h5></div>
<div class='panel-body content'>
<div class='panel'>
<div class='input-group' style="margin-bottom: 15px;">
<span class='input-group-addon'>线宽:</span>
<span class='input-group-addon' data-i18n="resources.text_lineWidth"></span>
<input type='text' class='form-control' id='lineWidth' value='2' onchange="lineWidthChanges()"/>
</div>
<div class='input-group' style="margin-bottom: 15px;">
<span class='input-group-addon'>线型:</span>
<select class='form-control' id='lineStyle' onchange="lineStyleChanges()">
<option value='0'>实线</option>
<option value='1'>长虚线</option>
<option value='2'>由点构成的直线</option>
<option value='3'>由线划线段组成的直线</option>
<option value='4'>由重复的线划点图案构成的直线</option>
</select>
<span class='input-group-addon' data-i18n="resources.text_lineType"></span>
<select class='form-control' id="lineStyle" onchange="lineStyleChanges()"></select>
</div>
<div class='input-group' style="margin-bottom: 15px;">
<span class='input-group-addon'>线色:</span>
<span class='input-group-addon' data-i18n="resources.text_lineColor"></span>
<input type="text" id="lineColor" value="" class='form-control'/>
<span class='input-group-addon'><img src='../img/colorpicker.png' id="cp1"
style="cursor:pointer z-index: 9999;"/></span>
</div>

<div class='input-group' style="margin-bottom: 15px;">
<span class='input-group-addon'>标号宽度:</span>
<span class='input-group-addon' data-i18n="resources.text_markerWidth"></span>
<input type='text' class='form-control' id='symbolWidth' value='40' onchange="symbolWidthChanges()"/>
</div>
<div class='input-group' style="margin-bottom: 15px;">
<span class='input-group-addon'>标号高度:</span>
<span class='input-group-addon' data-i18n="resources.text_markerHeight"></span>
<input type='text' class='form-control' id='symbolHeight' value='40' onchange="symbolHeightChanges()"/>
</div>
<div class='input-group' style="margin-bottom: 15px;">
<span class='input-group-addon'>使用缺省属性:</span>
<span class='input-group-addon' data-i18n="resources.text_defaultStyle"></span>
<select class='form-control' id='defaultStyleFlag' onchange="defaultStyleFlagChanges()">
<option value='0'>false</option>
<option value='1'>true</option>
</select>
</div>
</div>
<input type="button" class="btn btn-default" value="绘制标号" onclick="plotSymbol()"/>
<input type="button" class="btn btn-default" value="取消标绘" onclick="PlottingDrawCancel()"/>
<input type="button" class="btn btn-default" data-i18n="[value]resources.btn_drawMarker" onclick="plotSymbol()"/>
<input type="button" class="btn btn-default" data-i18n="[value]resources.btn_cancelMarker" onclick="PlottingDrawCancel()"/>
</div>
</div>
<div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>
Expand All @@ -60,7 +54,9 @@ <h5 class='panel-title text-center'>缺省属性</h5></div>
var host = window.isLocal ? window.server : "http://support.supermap.com.cn:8090";
var url = host + "/iserver/services/map-world/rest/maps/World";
var serverUrl = host + "/iserver/services/plot-jingyong/rest/plot/";
var map, symbolLibManager;
var map, symbolLibManager, plotting;
var item = ["实线","长虚线","由点构成的直线","由线划线段组成的直线","由重复的线划点图案构成的直线"],
select, lineStyle;
map = L.map('map', {
preferCanvas: true,
crs: L.CRS.EPSG4326,
Expand All @@ -75,7 +71,7 @@ <h5 class='panel-title text-center'>缺省属性</h5></div>
drawControl.addTo(map);
var editControl = L.supermap.plotting.editControl();
editControl.addTo(map);
var plotting = L.supermap.plotting.getControl(map, serverUrl);
plotting = L.supermap.plotting.getControl(map, serverUrl);
function loadSymbolLib() {
symbolLibManager = plotting.getSymbolLibManager();
symbolLibManager.on(SuperMap.Plot.Event.initializecompleted, initializeCompleted);
Expand All @@ -86,7 +82,8 @@ <h5 class='panel-title text-center'>缺省属性</h5></div>
}
function initHtml() {
document.getElementById("lineWidth").value = plotting.getDefaultStyle().lineWidth;
document.getElementById("lineStyle").value = '0';
document.getElementById("lineStyle").value = item[0];
//document.getElementById("lineStyle").value = item[plotting.getDefaultStyle().lineType];
document.getElementById("lineColor").value = plotting.getDefaultStyle().lineColor;
document.getElementById("symbolWidth").value = plotting.getDefaultStyle().dotSymbolSize;
document.getElementById("symbolHeight").value = plotting.getDefaultStyle().dotSymbolSize;
Expand All @@ -95,14 +92,50 @@ <h5 class='panel-title text-center'>缺省属性</h5></div>
else
document.getElementById("defaultStyleFlag").value = 0;
}



function selectLineType() {

var select = document.getElementById("lineStyle");
var type;
for (var i = 0; i < select.children.length; i++) {
if (select.children[i].selected) {
type = select.children[i].value;

}
}
if (type === item[0]) {
lineStyle = 0;
}
else if (type === item[1]) {
lineStyle = 1;
}
else if (type === item[2]) {
lineStyle = 2;
}
else if (type === item[3]) {
lineStyle = 3;
}
else if (type === item[4]) {
lineStyle = 4;
}
var obj = new Object();
obj.selectValue = type;
obj.lineStyle = lineStyle;
return obj;
}

function lineWidthChanges() {
PlottingDrawCancel();
plotting.getDefaultStyle().lineWidth = document.getElementById("lineWidth").value;
}

function lineStyleChanges() {
PlottingDrawCancel();
plotting.getDefaultStyle().lineType = document.getElementById("lineStyle").value;
var obj=selectLineType();
plotting.getDefaultStyle().lineType = obj.lineStyle;

}

function symbolWidthChanges() {
Expand Down Expand Up @@ -156,8 +189,18 @@ <h5 class='panel-title text-center'>缺省属性</h5></div>
PlottingDrawCancel();
plotting.getDefaultStyle().lineColor = document.getElementById("lineColor").value;
}

window.onload = function () {
select = document.getElementById("lineStyle");
for (var i = 0, len = item.length; i < len; i++) {
var options = document.createElement("option");
options.setAttribute("value", item[i]);
options.innerHTML = item[i];
select.appendChild(options);

}
loadSymbolLib();

};
</script>
</body>
Expand Down
12 changes: 6 additions & 6 deletions examples/leaflet/plot_drawGeoGraphicObject.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
<div id="toolbar" class="panel panel-primary" style=" position: absolute;top: 10px;right: 10px;text-align: center;z-index: 9999;border-radius: 4px;">
<div class='panel-heading'>
<h5 class='panel-title text-center'>点线面绘制</h5></div>
<h5 class='panel-title text-center' data-i18n="resources.title_drawGeoGraphicObject"></h5></div>
<div class='panel-body content'>
<input type="button" class="btn btn-default" value="绘点" onclick="draw_dot()"/>
<input type="button" class="btn btn-default" value="绘线" onclick="draw_line()"/>
<input type="button" class="btn btn-default" value="绘面" onclick="draw_polygon()"/>
<input type="button" class="btn btn-default" value="绘文字" onclick="draw_text()"/>
<input type="button" class="btn btn-default" value="清除" onclick="clearLayers()"/>
<input type="button" class="btn btn-default" data-i18n="[value]resources.text_input_value_drawPoint" onclick="draw_dot()"/>
<input type="button" class="btn btn-default" data-i18n="[value]resources.text_input_value_drawLine" onclick="draw_line()"/>
<input type="button" class="btn btn-default" data-i18n="[value]resources.text_input_value_drawPolygon" onclick="draw_polygon()"/>
<input type="button" class="btn btn-default" data-i18n="[value]resources.btn_drawText" onclick="draw_text()"/>
<input type="button" class="btn btn-default" data-i18n="[value]resources.text_input_value_clear" onclick="clearLayers()"/>
</div>
</div>
<div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>
Expand Down
30 changes: 15 additions & 15 deletions examples/leaflet/plot_drawGraphics.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,25 @@
<body>
<div id="toolbar" class="panel panel-primary" style=" position: absolute;top: 15px;right: 10px;text-align: center;z-index: 9999;border-radius: 4px;">
<div class='panel-heading'>
<h5 class='panel-title text-center' style=" font-size: 16px;color: #ffffff;">复杂对象</h5></div>
<h5 class='panel-title text-center' data-i18n="resources.title_drawGraphics" style=" font-size: 16px;color: #ffffff;"></h5></div>
<div class='panel-body content' style="padding: 10px;">
<div class='input-group' >
<input type="button" class="btn btn-default" value="航线1" onclick="createAirRoute()" />
<input type="button" class="btn btn-default" value="航线2" onclick="createNavyRoute()" />
<input type="button" class="btn btn-default" value="航线3" onclick="createMissileRoute()" />
<input type="button" class="btn btn-default" value="扇形区域" onclick="drawArcRegion()" />
<input type="button" class="btn btn-default" value="干扰波束" onclick="drawInterferenceBeam()" />
<input type="button" class="btn btn-default" value="对象标注" onclick="createSymbolText()" />
<input type="button" class="btn btn-default" value="对象标注1" onclick="createSymbolText1()" />
<input type="button" class="btn btn-default" value="卫星" onclick="drawSatellite()" />
<input type="button" class="btn btn-default" data-i18n="[value]resources.btn_route1" onclick="createAirRoute()" />
<input type="button" class="btn btn-default" data-i18n="[value]resources.btn_route2" onclick="createNavyRoute()" />
<input type="button" class="btn btn-default" data-i18n="[value]resources.btn_route3" onclick="createMissileRoute()" />
<input type="button" class="btn btn-default" data-i18n="[value]resources.btn_sectorArea" onclick="drawArcRegion()" />
<input type="button" class="btn btn-default" data-i18n="[value]resources.btn_interfereBeam" onclick="drawInterferenceBeam()" />
<input type="button" class="btn btn-default" data-i18n="[value]resources.btn_objectMarker" onclick="createSymbolText()" />
<input type="button" class="btn btn-default" data-i18n="[value]resources.btn_objectMarker1" onclick="createSymbolText1()" />
<input type="button" class="btn btn-default" data-i18n="[value]resources.btn_satellite" onclick="drawSatellite()" />
</div>
<div class='input-group'>
<input type="button" class="btn btn-default" value="兵力部署1" onclick="drawHJBLdeploy()" />
<input type="button" class="btn btn-default" value="兵力部署2" onclick="drawKJBLdeploy()" />
<input type="button" class="btn btn-default" value="卫星可见时间窗口1" onclick="drawSatelliteTimeWindows1()" />
<input type="button" class="btn btn-default" value="卫星可见时间窗口2" onclick="drawSatelliteTimeWindows2()" />
<input type="button" class="btn btn-default" value="编辑" onclick="editControlPoints()" />
<input type="button" class="btn btn-default" value="清空" onclick="clearMap()" />
<input type="button" class="btn btn-default" data-i18n="[value]resources.btn_troopDeploy1" onclick="drawHJBLdeploy()" />
<input type="button" class="btn btn-default" data-i18n="[value]resources.btn_troopDeploy2" onclick="drawKJBLdeploy()" />
<input type="button" class="btn btn-default" data-i18n="[value]resources.btn_satelliteWindow1" onclick="drawSatelliteTimeWindows1()" />
<input type="button" class="btn btn-default" data-i18n="[value]resources.btn_satelliteWindow2" onclick="drawSatelliteTimeWindows2()" />
<input type="button" class="btn btn-default" data-i18n="[value]resources.text_input_value_modify" onclick="editControlPoints()" />
<input type="button" class="btn btn-default" data-i18n="[value]resources.btn_clear" onclick="clearMap()" />
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit cc82765

Please sign in to comment.