HTML Viewer中同时显示Legend图例 和 Layerlist图层:: 定制过程

HTML Viewer中同时显示Legend图例 和 Layerlist图层:: 定制过程

第一步:viewer.htm 如下如下修改(添加红色区域代码)
 
<FRAME NAME="TOCFrame" SRC="TOCFrame.htm" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="Auto" FRAMEBORDER="No" RESIZE="YES"><?XML:NAMESPACE PREFIX = O />
to: 
                        <FRAMESET ROWS="*,50%">
                        <FRAME NAME="LegendFrame" SRC="LegendFrame.htm" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="Auto" FRAMEBORDER="No" RESIZE="YES">
                        <FRAME NAME="TOCFrame" SRC="TOCFrame.htm" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="Auto" FRAMEBORDER="No" RESIZE="YES">
                        </FRAMESET>
添加一个新的框架用于放置Legend

第二步:创建LegendFrame.htm :可以通过打开TOCFrame.htm 修改一下标题为legend  另存为LegendFrame.htm 即可

第三步:aimsLegend.js中showLegend function 中修改

将所有parent.TOCFrame.document改为parent.LegendFrame.document

第四步:aimsXML.js中getXYs function 中修改

if ((hasTOC) && (!legendVisible)) parent.TOCFrame.document.location = appDir + "toc.htm";

改为(去掉红色叹号即可)
 
if ((hasTOC) && (legendVisible)) parent.TOCFrame.document.location = appDir + "toc.htm";

第五步:在toolbar.htm注释掉以下蓝色部分代码(去掉 toggle 工具)

 
document.write('<tr>');         
                                    /*            if ((parent.MapFrame.hasTOC) && (parent.MapFrame.aimsLegendPresent)) {
                                                            // Legend toggle. . . requires aimsLegend.js
                                                            document.write('<td align="center" valign="middle">');
                                                            document.write('<img src="images/togglelegend.gif" width=16 height=16 hspace=1 vspace=0 border=0 alt="Legend/LayerList" name="legend" onmousedown="parent.MapFrame.clickFunction(\'legend\');" onmouseover="window.status=\'Toggle between Legend and LayerList\'">');
                                                            isSecond = !isSecond;
                                                            document.writeln('</td>');
                                                }   
         */
                                                if (parent.MapFrame.hasOVMap) {

第六步:确定将arcimsparam.js中showTOC, hasTOC和aimsMap.js中LegendVisible 设置为True!

ok!

效果如图:

posted on 2007-10-31 09:31  GIS云中飞鹏  阅读(1445)  评论(2编辑  收藏  举报

导航