Some Things You Might Want to do in Your Project

Add an Image Transition Effect - Internet Explorer allows you to fade one image into another and since all the map image files you see are just graphic images IE will do it just fine.  Since some filters do not work in Netscape, you will have to put all the code inside conditional statements that check to see what browser the user is using.  Netscape users will be able to use the site but will not have the transition filter.

Open the MapFrame.htm and find this text

createLayer("theMap",0,0,sWidth,sHeight,true,content);

There are several special filter effects - this one is a BlendTrans filter.  Below that line add this

if (isIE) document.theImage.style.filter = BlendTras(duration = "2")

This block of code should look like this now:

// map image
var content = '<img name="theImage" src="images/map.gif" hspace=0 vspace=0 border=0 width=' + mWidth + ' height=' + mHeight + '> ';
createLayer("theMap",0,0,sWidth,sHeight,true,content);
if(isIE) document.theImage.style.filter="BlendTrans(duration = 2)"
iWidth =mWidth;
iHeight = mHeight;
i2Width = locWidth;
i2Height = locHeight;

Now you need to trigger the effect when the HTML Viewer retrieves the image. 

Open the aimsXML.js file.

There can be multiple different types of filters and they all exist in an array.  The Apply() method allows you to select the filter to be used. Find the text:

if (theURL != "") {
getXYs(theReply);

Make sure you are in the  occurence of the above text that is in Case 1 of the processXML() function and add this text

if (isIE) document.theImage.filters[0].Apply();

Find the line (just below the one you added) that reads

document.theImage.src = theURL;

Below this line add the following code:

if (isIE) document.theImage.filters[0].Play();

The case 1 occurence of ProcessXML() should now look like this:

case 1:
//alert ("Received:\n\n" + theReply);
var theURL = "";
theURL = getURL(theReply);
//alert(theURL);
if (theURL != "") {
getXYs(theReply);
if (isIE) document.theImage.filters[0].Apply();
document.theImage.src = theURL;
if (isIE) document.theImage.filters[0].Play();
afterMapRefresh();
}

Save your changes to aimsXML.js and refresh your browser. As you change the image you should see it fade out.

Combine the Layer List and Legend

Most desktop GIS applications have the layer list and legend combined together in the table of contents.  In the HTML Viewer the layer list and legend are separate because the legend image produced by the Spatial Server does not allow the user to indicate which layer is active and which layers are visible (radio buttons and checkboxes). If you would like to have the layer list and legend combined together, custom code is need and you will have to create static legend elements rather than have the Spatial Server make the legend.

Rather than re-type what my book had, I went and got the information myself.  It came in an htm file and here it is:

DISPLAYING THE LEGEND AND THE LAYERLIST AT THE SAME TIME

Robert Meier helped the person who put this on the web  figure this out.  Bold, red type indicates added code.  Blue indicates deleted code.

Step One: In viewer.htm, change the following line:

<FRAME NAME="TOCFrame" SRC="TOCFrame.htm" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="Auto" FRAMEBORDER="No" RESIZE="YES">

to:  [Note:  Don't forget to add the closing elements that JavaScripting expects, '); and document.writeln('  at the beginning]

                        <FRAMESET ROWS="*,50%">

                        <FRAME NAME="LegendFrame" SRC="LegendFrame.htm" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="Auto" FRAMEBORDER="No" RESIZE="YES">

Note:  If your legend and layer list is small, setting SCROLLING = "No" takes unneeded scroll bars off and cleans up the frame.

                        <FRAME NAME="TOCFrame" SRC="TOCFrame.htm" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="Auto" FRAMEBORDER="No" RESIZE="YES">

                        </FRAMESET>

This creates a new frame for the legend to live in.

Step Two: Create LegendFrame.htm by opening TOCFrame.htm, editing the title tag to ‘legend’ and save as LegendFrame.htm. 

This is simply a placeholder that is initially loaded when the layout is first created.

  Step Three: In the showLegend function in aimsLegend.js, change all the parent.TOCFrame.document. lines to parent.LegendFrame.document.

This makes sure the legend gets put in the correct frame.

Step Four: In the getXYs function in aimsXML.js, change:

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

to:

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

We want the layerlist to draw even when the legend is visible.

Step Five: In toolbar.htm you can delete or comment out the code for the toggle toolbar like this:

            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) {

  Step Six:  You need to make sure that showTOC, hasTOC, and LegendVisible are set to True.  How this is done depends on what edits you have already made.  I made sure showTOC and hasTOC were set to true in arcimsparam.js.  I had already added and set legendVisible to true per the instructions for making the legend show up first.  I commented this out and made sure it was set to True in aimsMap.js.

Some additional thoughts:  Small legends and TOCs benefit from removal of the scroll bars (see above).  The legend color back ground is white so you could set the BGCOLOR attribute in TOC.htm to white as well.

Creating and Using Your Own Symbol for polygon fills

1.  Using Paint create a GIF image 16 x 16 of the pattern you want.  This is an example of a marsh pattern.

  If you are display this symbol on a white background you can stop here.  If you want this image to display over an air photo background you need to make the white background transparent.  Allegedly, this is possible in Corel Photo Paint 12 which is on all the computers in the lab but if you can figure it out, let me know.  I use an older version of MS Photo Editor which has a very simple tool to pick the color you want to be transparent and then save it as a transparent image.  Works great but that is not on these computers.

2. Change in the AXL file:  The "normal" <SIMPLERENDEDER> tag might look like this:

<SIMPLERENDERER>
<SIMPLEPOLYGONSYMBOL boundarytransparency="1.0" boundarywidth = "2" filltransparency="0.0" boundarycaptype="round" />
</SIMPLERENDERER>

You replace the <SIMPLEPOLYGONSYMBOL> tag with this:

<SIMPLERENDERER>
        <RASTERFILLSYMBOL url="http://cgissrv1/website/image_symbols/marsh_try3.gif" image = "e:\arcims\website\image_symbols\marsh_try3.gif" transparency = "1.0" />
</SIMPLERENDERER>
 

The url = is the URL to the location of the GIF file and the image variable is its location on the server.