<% ' Map Viewer (Third Edition) by Howie Sternberg at howies@snet.net. ' Map Viewer is placed in the public domain and is "Freeware". ' Map Viewer may be freely used and redistributed, is provided "AS-IS" ' without warranty of any kind, and there is no technical support provided. ' ------------------------ ' Viewer Include Variables ' ------------------------ Dim intMapStyleImgHeight ' Height of mapAnchor and mapWindow (pixels) Dim intMapStyleImgWidth ' Width of mapAnchor and mapWindow (pixels) Dim intMapStyleMapLeft ' Left position of mapAnchor (pixels) Dim intMapStyleMapTop ' Top postion of mapAnchor (pixels) Dim intMapStylePointLeft ' Left position of mapPoint (pixels) Dim intMapStylePointTop ' Top position of mapPoint (pixels) Dim strMapStylePointVisibility ' Visibility of mapPoint (pixels) for Identify function Dim intMapStyleNorthSouthLeft ' Left position of mapPanNorth and mapPanSouth (pixels) Dim intMapStyleNorthTop ' Top position of mapPanNorth (pixels) Dim intMapStyleSouthTop ' Top position of mapPanSouth (pixels) Dim intMapStyleEastWestTop ' Top postion of mapPanEast and mapPanWest (pixels) Dim intMapStyleEastLeft ' Left position of mapPanEast (pixels) Dim intMapStyleWestLeft ' Left position of mapPanWest (pixels) Dim intMapStyleToolsLeft ' Left poition of mapTools (pixels) Dim intMapStyleToolsTop ' Top position of mapTools (pixels) Dim intMapStyleDataLeft ' Left position of mapDataWrap (pixels) Dim intMapStyleDataTop ' Top position of mapDataWrap (pixels) Dim intMapStyleDataBottomLeft ' Left position of mapDataWrapBottom (pixels) Dim intMapStyleDataBottomTop ' Top position of mapDataWrapBottom (pixels) ' ----------- ' Viewer Subs ' ----------- Sub setDefaultMapViewerStyle(w,h) ' Calc style position variables based on left, top, width, height position and size of current map image Dim sList, aList sList = transformXMLfromFile("xml\mapviewer.xml","xsl\mapviewerposition.xsl") aList = Split(sList,"|") 'response.write sList 'response.end intMapStyleLeft = Cint(aList(0)) intMapStyleTop = Cint(aList(1)) intMapStyleImgWidth = w + 2 intMapStyleImgHeight = h + 2 intMapStyleToolsLeft = intMapStyleLeft intMapStyleToolsTop = intMapStyleTop intMapStyleMapLeft = intMapStyleLeft + 45 intMapStyleMapTop = intMapStyleTop + 23 intMapStylePointLeft = 0 intMapStylePointTop = 0 strMapStylePointVisibility = "hidden" intMapStyleNorthTop = intMapStyleTop + 13 intMapStyleSouthTop = intMapStyleMapTop + h + 4 intMapStyleNorthSouthLeft = intMapStyleMapLeft + (w / 2) -7 intMapStyleEastLeft = intMapStyleMapLeft + w + 4 intMapStyleWestLeft = intMapStyleMapLeft - 10 intMapStyleEastWestTop = intMapStyleMapTop + (h / 2) - 5 intMapStyleDataLeft = intMapStyleEastLeft + 20 intMapStyleDataTop = intMapStyleTop intMapStyleDataBottomLeft = intMapStyleMapLeft intMapStyleDataBottomTop = intMapStyleSouthTop + 7 End Sub Function getMapToolBar(sTool, dScale, dActiveMinScale, dActiveMaxScale, dIdentifyMinScale, dIdentifyMaxScale) ' Returns HTML for vertical map tool bar Dim s Dim sImgZoomin ' Zoom in tool image Dim sImgZoomout ' Zoom out tool image Dim sImgPan ' Pan tool image Dim sImgAutoSelect ' Auto select tool image Dim sImgSelect ' Select tool image Dim sImgIdentify ' Identify tool image Dim sAutoSelectOption ' setAutoSelect argument ' Set variables for map tool images, indicating active map tool. sImgZoomin = "zoomin_1.gif" ' Inactive sImgZoomout = "zoomout_1.gif" ' Inactive sImgPan = "pan_1.gif" ' Inactive sImgAutoSelect = "autoselect_0.gif" ' Disabled - gray color sImgSelect = "select_0.gif" ' Disabled - gray color sImgIdentify = "identify_0.gif" ' Disabled - gray color If ((dActiveMinScale < dScale) and (dScale < dActiveMaxScale)) Then sImgAutoSelect = "autoselect_1.gif" ' On sAutoSelectOption = "on" if (strMapOptionLevel3) = "autoselect" Then sImgAutoSelect = "autoselect_2.gif" ' Off sAutoSelectOption = "off" End If End If If ((dActiveMinScale < dScale) and (dScale < dActiveMaxScale)) Then sImgSelect = "select_1.gif" ' Inactive If (sTool = "select") Then sImgSelect = "select_2.gif" ' Active End If Else If (sTool = "select") Then ' Make zoomin active sTool = "zoomin" End If End If If ((dIdentifyMinScale < dScale) and (dScale < dIdentifyMaxScale)) Then sImgIdentify = "identify_1.gif" ' Inactive If (sTool = "identify") Then sImgIdentify = "identify_2.gif" ' Active End If Else If (sTool = "identify") Then ' Make zoomin active sTool = "zoomin" End If End If If (sTool = "zoomin") Then sImgZoomin = "zoomin_2.gif" ' Active Elseif (sTool = "zoomout") Then sImgZoomout = "zoomout_2.gif" ' Active Elseif (sTool = "pan") Then sImgPan = "pan_2.gif" ' Active Elseif (sTool = "identify") Then sImgIdentify = "identify_2.gif" ' Active End If ' write tool bar s = "" & vbCrLf s = s & "" & vbCrLf s = s & "" & vbCrLf s = s & "" & vbCrLf s = s & "" & vbCrLf s = s & "" & vbCrLf If ((dActiveMinScale < dScale) and (dScale < dActiveMaxScale)) Then s = s & "" & vbCrLf Else s = s & "" & vbCrLf End If If ((dActiveMinScale < dScale) and (dScale < dActiveMaxScale)) Then s = s & "" & vbCrLf Else s = s & "" & vbCrLf End If If (intActiveFeatureCount > 0) Then s = s & "" & vbCrLf Elseif ((dActiveMinScale < dScale) and (dScale < dActiveMaxScale)) Then s = s & "" & vbCrLf End If If ((dIdentifyMinScale < dScale) and (dScale < dIdentifyMaxScale)) Then s = s & "" & vbCrLf Else s = s & "" & vbCrLf End If If (Cbool(strEnableSearch)) Then s = s & "" & vbCrLf End If If (Cbool(strEnableLayers)) Then s = s & "" & vbCrLf End If If (Cbool(strEnableLegend)) Then s = s & "" & vbCrLf End If If (Cbool(strEnableProperties)) Then s = s & "" & vbCrLf End If If (Cbool(strEnablePrint)) Then s = s & "" & vbCrLf End If If (Cbool(strEnableAddNewMap)) Then s = s & "" & vbCrLf End If getMapToolBar = s End Function %>