% ' 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. ' ----------------- ' mapForm variables ' ----------------- Dim intMapStyleLeft ' Left position of Map Viewer (pixels) Dim intMapStyleTop ' Top position of Map Viewer (pixels) Dim strEnableLayers ' Enable Layers function (true or false) Dim strEnableSearch ' Enable Find Feature function (true or false) Dim strEnableLegend ' Enable Legend function (true or false) Dim strEnableProperties ' Enable Properties function (true or false) Dim strEnablePrint ' Enable Print function (true or false) Dim strEnableAddNewMap ' Enable Add New Map function (true or false) Dim strEnableAbout ' Enable About Map Viewer function (true or false) Dim strMapServerURLPrevious ' Map Server URL of previous map viewed Dim strMapServicePrevious ' Map Service of previous map viewed Dim strMapTitlePrevious ' Map Title of previous map viewed Dim strMapServerURL ' Map Server Dim strMapService ' Map Service Dim strMapTitle ' Map Title Dim strMapAction ' Map action: none, refreshmap, mapservice, changemapservice, resize, fullview, centerzoomin, centerzoomout, etc. Dim strMapTool ' Map tool: zoomin, zoomout, pan, identify, select Dim strMapOptionLevel1 ' Map Option1: none, identify Dim strMapOptionLevel2 ' Map Option2: none, layers, legend, data Dim strMapOptionLevel3 ' Map Option3: none, select, autoselect Dim strMapImg ' Map image URL Dim intMapImgX ' X coord for single click or X coord of LL corner of drag rect (pixels) Dim intMapImgY ' Y coord for single click or Y coord of LL corner of drag rect (pixels) Dim intMapImgX2 ' X coord of UR corner of drag rect (pixels) Dim intMapImgY2 ' Y coord of UR corner of drag rect (pixels) Dim dblMapMinX ' Map Min X (map units) Dim dblMapMaxX ' Map Max X (map units) Dim dblMapMinY ' Map Min Y (map units) Dim dblMapMaxY ' Map Max Y (map units) Dim intMapImgHeight ' Image height (pixels) Dim intMapImgWidth ' Image width (pixels) Dim dblMapDpi ' Map image pixels per inch Dim dblMapScale ' Map Scale (map units per pixel) Dim dblMapScaleDenominator ' Map Scale denominator (e.g. 24000) Dim dblPropertyMapScaleDenominator ' Map Scale denominator (e.g. 24000) Dim strPropertyMapScaleAppliesToPrint ' Map Scale ratio applies to printed map image or image displayed on screen (true or false) Dim intPropertyScreenWidthPixel ' Horizontal width of screen (pixels) Dim dblPropertyScreenWidthInch ' Horizontal width of screen (inches) Dim strPropertyImgPreserveView ' Preserve geographic area when changing Map Size (true or false) Dim intPropertyImgWidth ' Image width (pixels) Dim intPropertyImgHeight ' Image height (pixels) Dim dblPropertyNavigateMaxScale ' Max scale features are zoomed to by the Pan To function Dim dblPropertyFeatureMaxScale ' Max scale selected features are zoomed to Dim strPropertyFeatureMinMax ' Respect layer minmax for highlighting selected features (true or false) Dim strPropertyFeatureLimitList ' Max limit of selected features listed in attribute table Dim strPropertyFeatureColor ' Selected feature color (r,g,b) Dim strPropertyFeaturePointType ' Point symbol type Dim intPropertyFeaturePointWidth ' Point symbol size Dim strPropertyFeatureLineType ' Line symbol type Dim intPropertyFeatureLineWidth ' Line symbol size Dim strPropertyFeaturePolygonBoundary ' Render polygon boundary (true or false) Dim strPropertyFeaturePolygonFillType ' Polygon fill pattern Dim dblPropertyFeaturePolygonFillTransparency ' polygon fill transparency Dim strPropertyLabelMinMax ' Respect layer minmax when labeling selected features (true or false) Dim strPropertyLabelHowMany ' Number of labels per value Dim strPropertyLabelTextFont ' Font used for labeling Dim strPropertyLabelTextFontStyle ' Font Style used for labeling Dim intPropertyLabelTextFontSize ' Font Size used for labeling Dim strPropertyLabelTextFontColor ' Font Color used for labeling (r,g,b) Dim strPropertyLabelTextPrintMode ' Change case of labeled text Dim dblPropertyPanFactor ' Pan factor: 0.25, 0.50, 0.75, 1.00 Dim intPropertyZoomFactor ' Zoom factor: 2, 3, 4, 5 Dim strPropertyScaleUnits ' Scale bar units: feet, meters, miles, kilometers Dim strServiceType ' Map service type: imagemapserver or arcmapserver Dim strServiceCoordsSeparator ' Map service coords separator Dim strServiceTupleSeparator ' Map service tuple separator Dim strServiceScreenDpi ' Map service screen DPI Dim strServiceImageLimitPixelCount ' Map service pixel count Dim dblServiceMinX ' Map service envelope Min X (map units) Dim dblServiceMaxX ' Map service envelope Max X (map units) Dim dblServiceMinY ' Map service envelope Min Y (map units) Dim dblServiceMaxY ' Map service envelope Max Y (map units) Dim strServiceMapUnits ' Map service map units Dim strServiceLayerId ' List of LAYER id values: string|string|string... Dim strServiceLayerName ' List of LAYER name values: string|string|string... Dim strServiceLayerVisible ' List of LAYER visiblity: true|false|true... Dim strServiceLayerMinScale ' List of LAYER minscale values: string|string|string... Dim strServiceLayerMaxScale ' List of LAYER maxscale values: string|string|string... Dim strServiceLayerType ' List of LAYER type values: featureclass or image or acetate|featureclass or image or acetate|featureclass or image or acetate... Dim strServiceLayerFclass ' List of DATASET type values: point or line or polygon or non|point or line or polygon or none|point or line or polygon or none... Dim strServiceLayerRowId ' List of LAYER Row Id field names - field type = 99 (#ID# or x.y.OBJECTID): string|string|string... Dim strServiceLayerDateFields ' List of LAYER date fields - field type = 91: string,string|string|||string... Dim strLayersForm ' List of layers for Layers function Dim strLayersFormCanDoVisible ' List of layers for Layers form saying if visiblity can be changed: true|false... Dim strLayersFormCanDoLegend ' List of layers for Layers form saying if legend can be controlled can be changed: true|false... Dim strLayersFormCanDoIdentify ' List of layers for Layers form saying if layer can be identified: true|false... Dim strLayersFormCanDoSelect ' List of layers for Layers form saying if layer can be selected: true|false... Dim strLayersVisible ' List of current state of layer visibility: true|false... Dim strLayersLegend ' List of current state of layers to show legend: true|false... Dim strLayersIdentify ' List of current state of layers to identify: true|false... Dim dblIdentifyMinScale ' The smallest Min scale of all layers that can be identified Dim dblIdentifyMaxScale ' The largest Max scale of all layers that can be identified Dim intActiveLayerIndexPrevious ' Index of previously active layer in the array generated by strServiceLayerId Dim intActiveLayerIndex ' Index of (currently) active layer in the array generated by strServiceLayerId Dim strActiveFclass ' Active Layer feature class: point or line or poly Dim dblActiveMinScale ' Active Layer minscale Dim dblActiveMaxScale ' Active Layer maxscale Dim strActiveFields ' List of Active Layer field name list: string|string|string... Dim strActiveFieldsType ' List of Active Layer field types: number or text|number or text|number or text... Dim strActiveSortField ' Active Layer sort field Dim strActiveSortFieldDataType ' Active Layer sort field data type for querying and selecting features: number, text, boolean, date, other Dim strActiveSortFieldDataTypeSort ' Active Layer sort field data type for sorting selected features: number or text Dim strActiveSortOrder ' Active Layer sort order: ascending or descending Dim strActiveLabelField ' Active Layer label field Dim strActiveField ' List of fields used to query Active Layer features: string|string|string... Dim strActiveFieldVal ' List of field values used to query Active Layer features: string|string|string... Dim strActiveFieldDataType ' List of field data types used to query Active Layer features: number or text|number or text|number or text... Dim strActiveOperator ' List of operators used to query Active Layer features: like or =|like or =|like or = Dim strActiveLogicalOperator ' List of logical operators used to query Active Layer features and|and|and... Dim strActiveFeatureLimit ' Featurelimit used in query of Active features: All Dim strActiveBeginRecord ' Beginrecord used in query of Active features: 1 Dim strActiveListBeginRecord ' Begin record number of features listed in current table page: 1 or 26 or 51 or All, etc Dim dblActiveFilterMinX ' Envelope Min X used to query Active Layer features (map units) Dim dblActiveFilterMinY ' Envelope Min Y used to query Active Layer features (map units) Dim dblActiveFilterMaxX ' Envelope Max X used to query Active Layer features (map units) Dim dblActiveFilterMaxY ' Envelope Max Y used to query Active Layer features (map units) Dim intActiveFeatureCount ' Number of selected features Dim intSearchOptionPrevious ' Index of previous search option (see find.asp) Dim intSearchOption ' Index of current search option (see find.asp) Dim strSearchFeatureLimit ' Featurelimit used in to query Searh layer features: 25 or 50 or 100 or All, etc Dim strSearchBeginRecord ' Beginrecord used in to query Search layer features: 1 Dim strSearchListFeatureLimit ' Number of features listed per Search results page: 25 or 50 or 100 or All, etc Dim strSearchListBeginRecord ' Begin record number of features in Search results page: 1 or 26 or 51 or All, etc Dim intSearchLayerIndex ' Search Layer Id Dim strSearchFclass ' Search Layer feature class: point or line or polygon Dim strSearchFields ' Search Layer field name list: string|string|string... Dim strSearchFieldsType ' Search Layer field types: number or text|number or text|number or text... Dim strSearchField ' Search field name Dim strSearchFieldVal ' Search field value Dim strSearchFieldDataType ' Search field data type: number or text Dim strSearchOperator ' Search query operator: like or = Dim strSearchSortField ' Sort field name Dim strSearchSortOrder ' Sort order: ascending or descending Dim intNavigateLayerIndex ' Index of layer used to navigate map Dim strNavigateLayerField ' Field name (objectid) in navigate map layer Dim strNavigateLayerFieldVal ' Field value of feature navigated to Dim strNavigateLayerFieldDataType ' Field data type for querying for feature to navigate to: number, text, boolean, date, other Dim strPrintTitle ' Map title name Dim strPrintPlacement ' Map placements: left, right, above, below, none ' ------------ ' mapForm Subs ' ------------ Sub initMapFormVariables() intMapStyleLeft = 0 intMapStyleTop = 0 strEnableLayers = "" strEnableSearch = "" strEnableLegend = "" strEnableProperties = "" strEnablePrint = "" strEnableAddNewMap = "" strEnableAbout = "" strMapServerURLPrevious = "" strMapServicePrevious = "" strMapTitlePrevious = "" strMapServerURL = "" strMapService = "" strMapTitle = "" strMapAction = 0 strMapTool = "" strMapOptionLevel1 = "" strMapOptionLevel2 = "" strMapOptionLevel3 = "" strMapImg = "" intMapImgX = 0 intMapImgY = 0 intMapImgX2 = 0 intMapImgY2 = 0 dblMapMinX = 0 dblMapMaxX = 0 dblMapMinY = 0 dblMapMaxY = 0 intMapImgHeight = 0 intMapImgWidth = 0 dblMapDpi = 0 dblMapScale = 0 dblMapScaleDenominator = 0 dblPropertyMapScaleDenominator = 0 strPropertyMapScaleAppliesToPrint = "" intPropertyScreenWidthPixel = 0 dblPropertyScreenWidthInch = 0 strPropertyImgPreserveView = "" intPropertyImgWidth = 0 intPropertyImgHeight = 0 dblPropertyNavigateMaxScale = 0 dblPropertyFeatureMaxScale = 0 strPropertyFeatureMinMax = "" strPropertyFeatureLimitList = "" strPropertyFeatureColor = "" strPropertyFeaturePointType = "" intPropertyFeaturePointWidth = 0 strPropertyFeatureLineType = "" intPropertyFeatureLineWidth = 0 strPropertyFeaturePolygonBoundary = "" strPropertyFeaturePolygonFillType = "" dblPropertyFeaturePolygonFillTransparency = 0 strPropertyLabelTextFont = "" strPropertyLabelTextFontStyle = "" intPropertyLabelTextFontSize = 0 strPropertyLabelTextFontColor = "" strPropertyLabelTextPrintMode = "" strPropertyLabelHowMany = "" strPropertyLabelMinMax = "" dblPropertyPanFactor = 0 intPropertyZoomFactor = 0 strPropertyScaleUnits = "" strServiceType = "" strServiceCoordsSeparator = "" strServiceTupleSeparator = "" strServiceScreenDpi = "" strServiceImageLimitPixelCount = "" dblServiceMinX = 0 dblServiceMaxX = 0 dblServiceMinY = 0 dblServiceMaxY = 0 strServiceMapUnits = "" strServiceLayerId = "" strServiceLayerName = "" strServiceLayerVisible = "" strServiceLayerMinScale = "" strServiceLayerMaxScale = "" strServiceLayerType = "" strServiceLayerFclass = "" strServiceLayerRowId = "" strServiceLayerDateFields = "" strLayersForm = "" strLayersFormCanDoVisible = "" strLayersFormCanDoLegend = "" strLayersFormCanDoIdentify = "" strLayersFormCanDoSelect = "" strLayersVisible = "" strLayersLegend = "" strLayersIdentify = "" dblIdentifyMinScale = 0 dblIdentifyMaxScale = 0 intActiveLayerIndexPrevious = -2 intActiveLayerIndex = -1 strActiveFclass = "" dblActiveMinScale = 0 dblActiveMaxScale = 0 strActiveFields = "" strActiveFieldsType = "" strActiveSortField = "" strActiveSortFieldDataType = "" strActiveSortFieldDataTypeSort = "" strActiveSortOrder = "" strActiveLabelField = "" strActiveField = "" strActiveFieldVal = "" strActiveFieldDataType = "" strActiveOperator = "" strActiveLogicalOperator = "" strActiveFeatureLimit = "" strActiveBeginRecord = "" strActiveListBeginRecord = "" dblActiveFilterMinX = 0 dblActiveFilterMinY = 0 dblActiveFilterMaxX = 0 dblActiveFilterMaxY = 0 intActiveFeatureCount = 0 intSearchOptionPrevious = 0 intSearchOption = 0 strSearchFeatureLimit = "" strSearchBeginRecord = "" strSearchListFeatureLimit = "" strSearchListBeginRecord = "" intSearchLayerIndex = 0 strSearchFclass = "" strSearchFields = "" strSearchFieldsType = "" strSearchField = "" strSearchFieldVal = "" strSearchFieldDataType = "" strSearchOperator = "" strSearchSortField = "" strSearchSortOrder = "" intNavigateLayerIndex = -1 strNavigateLayerField = "" strNavigateLayerFieldVal = "" strNavigateLayerFieldDataType = "" strPrintTitle = "" strPrintPlacement = "" End Sub Sub readMapForm() ' Read form or query string elements. Populate variables. intMapStyleLeft = Cint(Request("styleleft")) intMapStyleTop = Cint(Request("styletop")) strEnableLayers = Request("enablelayers") strEnableSearch = Request("enablesearch") strEnableLegend = Request("enablelegend") strEnableProperties = Request("enableproperties") strEnablePrint = Request("enableprint") strEnableAddNewMap = Request("enableaddnewmap") strEnableAbout = Request("enableabout") strMapServerURL = Request("mapserverurl") strMapService = Request("mapservice") strMapTitle = Request("maptitle") strMapServerURLPrevious = Request("mapserverurlprevious") strMapServicePrevious = Request("mapserviceprevious") strMapTitlePrevious = Request("maptitleprevious") strMapAction = Request("mapaction") strMapTool = Request("maptool") strMapOptionLevel1 = Request("mapoptionlevel1") strMapOptionLevel2 = Request("mapoptionlevel2") strMapOptionLevel3 = Request("mapoptionlevel3") intMapImgWidth = Cint(Request("mapimgwidth")) intMapImgHeight = Cint(Request("mapimgheight")) strMapImg = Request("mapimg") intMapImgX = Cdbl(Request("mapimgx")) intMapImgY = Cdbl(Request("mapimgy")) intMapImgX2 = Cdbl(Request("mapimgx2")) intMapImgY2 = Cdbl(Request("mapimgy2")) dblMapMinX = Cdbl(Request("mapminx")) dblMapMaxX = Cdbl(Request("mapmaxx")) dblMapMinY = Cdbl(Request("mapminy")) dblMapMaxY = Cdbl(Request("mapmaxy")) dblMapMinY = Cdbl(Request("mapminy")) dblMapDpi = Cdbl(Request("mapdpi")) dblMapScale = Cdbl(Request("mapscale")) dblMapScaleDenominator = Cdbl(Request("mapscaledenominator")) dblPropertyMapScaleDenominator = Cdbl(Request("propertymapscaledenominator")) strPropertyMapScaleAppliesToPrint = Request("propertymapscaleappliestoprint") intPropertyScreenWidthPixel = Cint(Request("propertyscreenwidthpixel")) dblPropertyScreenWidthInch = Cdbl(Request("propertyscreenwidthinch")) strPropertyImgPreserveView = Request("propertyimgpreserveview") intPropertyImgWidth = Cint(Request("propertyimgwidth")) intPropertyImgHeight = Cint(Request("propertyimgheight")) dblPropertyNavigateMaxScale = Cdbl(Request("propertynavigatemaxscale")) dblPropertyFeatureMaxScale = Cdbl(Request("propertyfeaturemaxscale")) strPropertyFeatureMinMax = Request("propertyfeatureminmax") strPropertyFeatureLimitList = Request("propertyfeaturelimitlist") strPropertyFeatureColor = Request("propertyfeaturecolor") strPropertyFeaturePointType = Request("propertyfeaturepointtype") intPropertyFeaturePointWidth = Cint(Request("propertyfeaturepointwidth")) strPropertyFeatureLineType = Request("propertyfeaturelinetype") intPropertyFeatureLineWidth = Cint(Request("propertyfeaturelinewidth")) strPropertyFeaturePolygonBoundary = Request("propertyfeaturepolygonboundary") strPropertyFeaturePolygonFillType = Request("propertyfeaturepolygonfilltype") dblPropertyFeaturePolygonFillTransparency = Cdbl(Request("propertyfeaturepolygonfilltransparency")) strPropertyLabelTextFont = Request("propertylabeltextfont") strPropertyLabelTextFontStyle = Request("propertylabeltextfontstyle") intPropertyLabelTextFontSize = Cint(Request("propertylabeltextfontsize")) strPropertyLabelTextFontColor = Request("propertylabeltextfontcolor") strPropertyLabelTextPrintMode = Request("propertylabeltextprintmode") strPropertyLabelHowMany = Request("propertylabelhowmany") strPropertyLabelMinMax = Request("propertylabelminmax") dblPropertyPanFactor = Cdbl(Request("propertypanfactor")) intPropertyZoomFactor = Cint(Request("propertyzoomfactor")) strPropertyScaleUnits = Request("propertyscaleunits") strServiceType = Request("servicetype") strServiceCoordsSeparator = Request("servicecoordsseparator") strServiceTupleSeparator = Request("servicetupleseparator") strServiceScreenDpi = Request("servicescreendpi") strServiceImageLimitPixelCount = Request("serviceimagelimitpixelcount") dblServiceMinX = Cdbl(Request("serviceminx")) dblServiceMaxX = Cdbl(Request("servicemaxx")) dblServiceMinY = Cdbl(Request("serviceminy")) dblServiceMaxY = Cdbl(Request("servicemaxy")) strServiceMapUnits = Request("servicemapunits") strServiceLayerId = Request("servicelayerid") strServiceLayerName = Request("servicelayername") strServiceLayerVisible = Request("servicelayervisible") strServiceLayerMinScale = Request("servicelayerminscale") strServiceLayerMaxScale = Request("servicelayermaxscale") strServiceLayerType = Request("servicelayertype") strServiceLayerFclass = Request("servicelayerfclass") strServiceLayerRowId = Request("servicelayerrowid") strServiceLayerDateFields = Request("servicelayerdatefields") strLayersForm = Request("layersform") strLayersFormCanDoVisible = Request("layersformcandovisible") strLayersFormCanDoLegend = Request("layersformcandolegend") strLayersFormCanDoIdentify = Request("layersformcandoidentify") strLayersFormCanDoSelect = Request("layersformcandoselect") strLayersVisible = Request("layersvisible") strLayersLegend = Request("layerslegend") strLayersIdentify = Request("layersidentify") dblIdentifyMinScale = Cdbl(Request("identifyminscale")) dblIdentifyMaxScale = Cdbl(Request("identifymaxscale")) intActiveLayerIndexPrevious = Cint(Request("activelayerindexprevious")) intActiveLayerIndex = Cint(Request("activelayerindex")) strActiveFclass = Request("activefclass") dblActiveMinScale = Cdbl(Request("activeminscale")) dblActiveMaxScale = Cdbl(Request("activemaxscale")) strActiveFields = Request("activefields") strActiveFieldsType = Request("activefieldstype") strActiveSortField = Request("activesortfield") strActiveSortFieldDataType = Request("activesortfielddatatype") strActiveSortFieldDataTypeSort = Request("activesortfielddatatypesort") strActiveSortOrder = Request("activesortorder") strActiveLabelField = Request("activelabelfield") strActiveField = Request("activefield") strActiveFieldVal = Request("activefieldval") strActiveFieldDataType = Request("activefielddatatype") strActiveOperator = Request("activeoperator") strActiveLogicalOperator = Request("activelogicaloperator") strActiveFeatureLimit = Request("activefeaturelimit") strActiveBeginRecord = Request("activebeginrecord") strActiveListBeginRecord = Request("activelistbeginrecord") dblActiveFilterMinX = Cdbl(Request("activefilterminx")) dblActiveFilterMinY = Cdbl(Request("activefilterminy")) dblActiveFilterMaxX = Cdbl(Request("activefiltermaxx")) dblActiveFilterMaxY = Cdbl(Request("activefiltermaxy")) intActiveFeatureCount = Cint(Request("activefeaturecount")) intSearchOptionPrevious = Cint(Request("searchoptionprevious")) intSearchOption = Cint(Request("searchoption")) strSearchFeatureLimit = Request("searchfeaturelimit") strSearchBeginRecord = Request("searchbeginrecord") strSearchListFeatureLimit = Request("searchlistfeaturelimit") strSearchListBeginRecord = Request("searchlistbeginrecord") intSearchLayerIndex = Cint(Request("searchlayerindex")) strSearchFclass = Request("searchfclass") strSearchFields = Request("searchfields") strSearchFieldsType = Request("searchfieldstype") strSearchField = Request("searchfield") strSearchFieldVal = Request("searchfieldval") strSearchFieldDataType = Request("searchfieldatatype") strSearchOperator = Request("searchoperator") strSearchSortField = Request("searchsortfield") strSearchSortOrder = Request("searchsortorder") intNavigateLayerIndex = Cint(Request("navigatelayerindex")) strNavigateLayerField = Request("navigatelayerfield") strNavigateLayerFieldVal = Request("navigatelayerfieldval") strNavigateLayerFieldDataType = Request("navigatelayerfielddatatype") strPrintTitle = Request("printtitle") strPrintPlacement = Request("printplacement") End Sub Sub writeMapForm() ' This sub creates the mapForm with either text or hidden input types. Parameters for typ are 'text' or 'hidden'. ' Discussion: The typ parameter sets the type for all input elements in the form. It can be set to 'hidden' or 'text'. ' Certain Javascript functions call mapForm.reset() to revert all form elements to their original values (when the ' page first loaded) prior to populating the form elements with different values and submitting the form. In Map Viewer, ' a single mapForm can be submitted more than once because you can go back to pages in history. Before resubmitting the form, ' the previously submitted values are cleared by using mapForm.reset() so the form reverts back to its orginal state. ' However, since it appears the reset() function in Netscape 7 ONLY resets form elements to their original values if ' their type is 'text' and not 'hidden', the only way to support Netscape 7 and still not see the form was to use ' 'text' input types and contain the form in a DIV tag whose visibility is hidden. Response.Write "
" End Sub %>