| | |
| | | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| | | <meta name="viewport" |
| | | content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> |
| | | <title>属性</title> |
| | | <title>Property</title> |
| | | <link rel="stylesheet" href="../layui/css/layui.css"> |
| | | <style> |
| | | html, |
| | |
| | | .outline { |
| | | display: none; |
| | | } |
| | | .layui-colorpicker-main-input input.layui-input{ |
| | | width:135px; |
| | | } |
| | | </style> |
| | | </head> |
| | | |
| | | <body> |
| | | <div id="Attribute" style="margin:0 10px;"> |
| | | <div class="attrTitle"> |
| | | <legend>样式信息</legend> |
| | | <!-- <button type="button" class="layui-btn layui-btn-danger removeGraphic" onclick="removeGraphic()">移除</button> --> |
| | | <legend id="styleInfo"></legend> |
| | | </div> |
| | | <!--贴地线--> |
| | | <div class="props GroundPolyline" style="display: none"> |
| | | <form class="layui-form" action=""> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">类型</label> |
| | | <div class="layui-input-block" style="line-height: 38px;"> |
| | | 贴地线 |
| | | <label class="layui-form-label" id="labelLineType"></label> |
| | | <div class="layui-input-block" style="line-height: 38px;" id="clampToGroundLine"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">名称</label> |
| | | <label class="layui-form-label" id="labelLineName"></label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="name" lay-verify="title" autocomplete="off" placeholder="0" value="贴地线" |
| | | <input type="text" name="name" lay-verify="title" autocomplete="off" placeholder="0" id="inputLineName" value="" |
| | | class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">线宽</label> |
| | | <label class="layui-form-label" id="labelLineWidth"></label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="width" lay-verify="title" autocomplete="off" placeholder="0" |
| | | onkeyup="value=value.replace(/[^\d\.]/g,'')" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item" style="height: 40px;"> |
| | | <label class="layui-form-label">填充色</label> |
| | | <div class="layui-input-block"> |
| | | <label class="layui-form-label" id="labelLineFillColor"></label> |
| | | <div class="layui-input-block" onclick="changeLanguage()"> |
| | | <div id="colorchk-GroundPolyline" style="display: inline-block;margin-top: 2px;"></div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item" style="position:relative;border: 1px #fff solid;"> |
| | | <label class="layui-form-label">填充透明度</label> |
| | | <label class="layui-form-label" id="labelLineFillAlpha"></label> |
| | | <div class="layui-input-block" style="position: absolute;top: 16px"> |
| | | <div id="opacity-GroundPolyline" class="demo-slider"></div> |
| | | </div> |
| | |
| | | <div class="props GroundPolygon" style="display: none"> |
| | | <form class="layui-form" action=""> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">类型</label> |
| | | <div class="layui-input-block" style="line-height: 38px;"> |
| | | 贴地面 |
| | | <label class="layui-form-label" id="labelPolygonType"></label> |
| | | <div class="layui-input-block" style="line-height: 38px;" id="clampToGroundPolygon"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">名称</label> |
| | | <label class="layui-form-label" id="labelPolygonName"></label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="name" lay-verify="title" autocomplete="off" placeholder="0" value="贴地面" |
| | | <input type="text" name="name" lay-verify="title" autocomplete="off" placeholder="0" id="inputPolygonName" value="" |
| | | class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item" style="height: 40px;"> |
| | | <label class="layui-form-label">填充色</label> |
| | | <div class="layui-input-block"> |
| | | <label class="layui-form-label" id="labelPolygonFillColor"></label> |
| | | <div class="layui-input-block" onclick="changeLanguage()"> |
| | | <div id="colorchk-GroundPolygon" style="display: inline-block;margin-top: 2px;"></div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item" style="position:relative;border: 1px #fff solid;"> |
| | | <label class="layui-form-label">填充透明度</label> |
| | | <label class="layui-form-label" id="labelPolygonFillAlpha"></label> |
| | | <div class="layui-input-block" style="position: absolute;top: 16px"> |
| | | <div id="opacity-GroundPolygon" class="demo-slider"></div> |
| | | </div> |
| | |
| | | <div class="props ExtrudedPolygon" style="display: none"> |
| | | <form class="layui-form" action=""> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">类型</label> |
| | | <div class="layui-input-block" style="line-height: 38px;"> |
| | | 拉伸面 |
| | | <label class="layui-form-label" id="labelExtrudeType"></label> |
| | | <div class="layui-input-block" style="line-height: 38px;" id="extrudePolygon"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">名称</label> |
| | | <label class="layui-form-label" id="labelExtrudeName"></label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="name" lay-verify="title" autocomplete="off" placeholder="0" value="拉伸面" |
| | | <input type="text" name="name" lay-verify="title" autocomplete="off" placeholder="0" id="inputExtrudeName" value="" |
| | | class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item" style="height: 40px;"> |
| | | <label class="layui-form-label">填充色</label> |
| | | <div class="layui-input-block"> |
| | | <label class="layui-form-label" id="labelExtrudeFillColor"></label> |
| | | <div class="layui-input-block" onclick="changeLanguage()"> |
| | | <div id="colorchk-ExtrudedPolygon" style="display: inline-block;margin-top: 2px;"></div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item" style="position:relative"> |
| | | <label class="layui-form-label">填充透明度</label> |
| | | <label class="layui-form-label" id="labelExtrudeFillAlpha"></label> |
| | | <div class="layui-input-block" style="position: absolute;top: 16px"> |
| | | <div id="opacity-ExtrudedPolygon" class="demo-slider"></div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">拉伸高度</label> |
| | | <label class="layui-form-label" id="labelExtrudeHeight"></label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="height" lay-verify="title" autocomplete="off" placeholder="0" |
| | | onkeyup="value=value.replace(/[^\d\.]/g,'')" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item" style="border: 1px #fff solid;"> |
| | | <label class="layui-form-label">是否显示边框</label> |
| | | <label class="layui-form-label" id="labelShowBorder"></label> |
| | | <div class="layui-input-block"> |
| | | <input type="checkbox" lay-skin="switch" id="showExtrudedPolygonOutline" |
| | | lay-filter="showExtrudedPolygonOutline" title="开关"> |
| | | lay-filter="showExtrudedPolygonOutline" lay-text=""> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item outline" style="height: 40px;border-top: none;"> |
| | | <label class="layui-form-label">边框色</label> |
| | | <div class="layui-input-block"> |
| | | <label class="layui-form-label" id="labelBorderColor"></label> |
| | | <div class="layui-input-block" onclick="changeLanguage()"> |
| | | <div id="colorchk-ExtrudedPolygon2" style="display: inline-block;margin-top: 2px;"></div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item outline" style="position:relative;border: 1px #fff solid;"> |
| | | <label class="layui-form-label">边框透明度</label> |
| | | <label class="layui-form-label" id="labelBorderAlpha"></label> |
| | | <div class="layui-input-block" style="position: absolute;top: 16px"> |
| | | <div id="opacity-ExtrudedPolygon2" class="demo-slider"></div> |
| | | </div> |
| | |
| | | var PopupData = parent.SmartEarthPopupData; |
| | | var type = PopupData.propType; |
| | | var editGraphic = PopupData.editGraphic; |
| | | function changeLanguage() { |
| | | var elementClear = document.getElementsByClassName("layui-btn layui-btn-sm") |
| | | if(elementClear.length === 2 ){ |
| | | elementClear[0].innerText = `${Viewer.language.COMMON_CLEAR}` |
| | | elementClear[1].innerText = `${Viewer.language.COMMON_CONFIRM}` |
| | | } |
| | | } |
| | | document.getElementById("styleInfo").innerText = `${Viewer.language.SG_STYLE_INFO}` |
| | | //贴地线 |
| | | document.getElementById("labelLineType").innerText = `${Viewer.language.SG_PROP_TYPE}` |
| | | document.getElementById("clampToGroundLine").innerText = `${Viewer.language.SG_CLAMP_TO_GROUND_LINE}` |
| | | document.getElementById("labelLineName").innerText = `${Viewer.language.SG_PROP_NAME}` |
| | | document.getElementById("inputLineName").setAttribute('value',`${Viewer.language.SG_CLAMP_TO_GROUND_LINE}`) |
| | | document.getElementById("labelLineWidth").innerText = `${Viewer.language.SG_PROP_LINE_WIDTH}` |
| | | document.getElementById("labelLineFillColor").innerText = `${Viewer.language.SG_PROP_FILL_COLOR}` |
| | | document.getElementById("labelLineFillAlpha").innerText = `${Viewer.language.SG_PROP_FILL_ALPHA}` |
| | | //贴地面 |
| | | document.getElementById("labelPolygonType").innerText = `${Viewer.language.SG_PROP_TYPE}` |
| | | document.getElementById("clampToGroundPolygon").innerText = `${Viewer.language.SG_CLAMP_TO_GROUND_POLYGON}` |
| | | document.getElementById("labelPolygonName").innerText = `${Viewer.language.SG_PROP_NAME}` |
| | | document.getElementById("inputPolygonName").setAttribute('value',`${Viewer.language.SG_CLAMP_TO_GROUND_POLYGON}`) |
| | | document.getElementById("labelPolygonFillColor").innerText = `${Viewer.language.SG_PROP_FILL_COLOR}` |
| | | document.getElementById("labelPolygonFillAlpha").innerText = `${Viewer.language.SG_PROP_FILL_ALPHA}` |
| | | //拉伸面 |
| | | document.getElementById("labelExtrudeType").innerText = `${Viewer.language.SG_PROP_TYPE}` |
| | | document.getElementById("extrudePolygon").innerText = `${Viewer.language.SG_EXTRUDE_POLYGON}` |
| | | document.getElementById("labelExtrudeName").innerText = `${Viewer.language.SG_PROP_NAME}` |
| | | document.getElementById("inputExtrudeName").setAttribute('value',`${Viewer.language.SG_EXTRUDE_POLYGON}`) |
| | | document.getElementById("labelExtrudeFillColor").innerText = `${Viewer.language.SG_PROP_FILL_COLOR}` |
| | | document.getElementById("labelExtrudeFillAlpha").innerText = `${Viewer.language.SG_PROP_FILL_ALPHA}` |
| | | document.getElementById("labelExtrudeHeight").innerText = `${Viewer.language.SG_EXTRUDE_HEIGHT}` |
| | | document.getElementById("labelShowBorder").innerText = `${Viewer.language.SG_PROP_SHOW_BORDER}` |
| | | document.getElementById("labelBorderColor").innerText = `${Viewer.language.SG_PROP_BORDER_COLOR}` |
| | | document.getElementById("labelBorderAlpha").innerText = `${Viewer.language.SG_PROP_BORDER_ALPHA}` |
| | | document.getElementById("showExtrudedPolygonOutline").setAttribute("lay-text", `${Viewer.language.SG_ON_OR_OFF}`) |
| | | |
| | | !editGraphic && (editGraphic = {}); |
| | | if (editGraphic.graphic && editGraphic.graphic.material && editGraphic.graphic.material.color && editGraphic.graphic.material.color._value) { |
| | | getFillColor(editGraphic.graphic.material.color._value); |
| | |
| | | var value = $(this).val().replace(/[^\d\.]/g, ''); |
| | | if (value === '' || value === '.') return; |
| | | if (editGraphic.graphic && editGraphic.graphic.width) { |
| | | if(editGraphic.graphic.customData){ |
| | | editGraphic.graphic.customData.forEach(element => { |
| | | if(element.polyline) { |
| | | element.polyline.width = parseFloat(value); |
| | | } |
| | | if(element.polygon){ |
| | | element.polygon.width = parseFloat(value); |
| | | } |
| | | |
| | | }); |
| | | } else { |
| | | editGraphic.graphic.width = parseFloat(value); |
| | | } |
| | | } |
| | | }); |
| | | |
| | |
| | | , max: 100 //最大值 |
| | | , value: editGraphic.alpha |
| | | , change: function (value) { |
| | | if(editGraphic.graphic.customData){ |
| | | editGraphic.graphic.customData.forEach(element => { |
| | | if(element.polyline) { |
| | | element.polyline.material._color._value.alpha = value / 100; |
| | | } |
| | | if(element.polygon){ |
| | | element.polygon.material._color._value.alpha = value / 100; |
| | | } |
| | | }); |
| | | } else { |
| | | editGraphic.graphic.material._color._value.alpha = value / 100; |
| | | } |
| | | } |
| | | }); |
| | | |
| | |
| | | elem: '#colorchk-GroundPolyline' |
| | | , color: (editGraphic && editGraphic.fillColor) || '#ff0000' //设置默认色 |
| | | , done: function (color) { |
| | | editGraphic.fillColor = color; |
| | | editGraphic.fillColor = color; |
| | | editGraphic.graphic.material.color.setValue(new Cesium.Color.fromCssColorString(editGraphic.fillColor).withAlpha(editGraphic.alpha / 100)); |
| | | if(editGraphic.graphic.customData){ |
| | | editGraphic.graphic.customData.forEach(element => { |
| | | if(element.polyline) { |
| | | element.polyline.material.color.setValue(new Cesium.Color.fromCssColorString(editGraphic.fillColor).withAlpha(editGraphic.alpha / 100)); |
| | | } |
| | | if(element.polygon){ |
| | | element.polygon.material.color.setValue(new Cesium.Color.fromCssColorString(editGraphic.fillColor).withAlpha(editGraphic.alpha / 100)); |
| | | } |
| | | }); |
| | | } else { |
| | | editGraphic.graphic.material.color.setValue(new Cesium.Color.fromCssColorString(editGraphic.fillColor).withAlpha(editGraphic.alpha / 100)); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |