基于SVG技术实现WebGIS的基本功能(2)


   
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-indent: 24pt;"><span lang="EN-US"><font size="3">function searchFeature(featureName)</font></span>

<p class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt; text-indent: 24pt;"><span lang="EN-US"><font size="3">var svgDoc = document.mysvg.getSVGDocument();</font></span>

<p class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt; text-indent: 24pt;"><span lang="EN-US"><font size="3">if (svgObj)</font></span>

<p class="MsoNormal" style="margin: 0cm 0cm 0pt 39pt; text-indent: 24pt;"><span lang="EN-US"><font size="3">var svgStyle = svgObj.getStyle();</font></span>

<p class="MsoNormal" style="margin: 0cm 0cm 0pt 18pt; text-indent: 24pt;"><span lang="EN-US"><font size="3">}</font></span>

<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-indent: 24pt;"><span style=""><font size="3">下面对如何实现地图的图层管理功能进行说明。</font></span>

<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-indent: 24pt;"><span lang="EN-US"><font size="3"><g id="Soil" style="opacity:1.0;visibility:visible;"></g></font></span>

<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-indent: 24pt;"><span lang="EN-US"><font size="3">function setMapLayerVisible(id, checkBool)</font></span>

<p class="MsoNormal" style="margin: 0cm 0cm 0pt 24pt; text-indent: 24pt;"><span lang="EN-US"><font size="3">var svgObj = svgdoc.getElementById(id);</font></span>

<p class="MsoNormal" style="margin: 0cm 0cm 0pt 24pt; text-indent: 24pt;"><span lang="EN-US"><font size="3">if (checkBool) </font></span>

<p class="MsoNormal" style="margin: 0cm 0cm 0pt 24pt; text-indent: 24pt;"><span lang="EN-US"><font size="3">else </font></span>

<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-indent: 24pt;"><span lang="EN-US"><font size="3">}</font></span>

<span lang="EN-US" style=""><span style=""> </span></span><span style="">还有其它一些</span><span lang="EN-US" style="">GIS</span><span style="">相关的基本功能,比如,显示地理对象信息、改变图元颜色、地理对象坐标的显示等等,基本都和上面的代码相类似,可以通过</span><span lang="EN-US" style="">DOM</span><span style="">接口直接操作</span><span lang="EN-US" style="">SVG</span><span style="">文件。</span>
 

你可能感兴趣的:(java,工作)