background image

April 2004

Autodesk MapGuide® LiteView

Developer’s Guide

Summary of Contents for 15606-011408-9330 - MAPGUIDE R6.3 SITE LIC-UPG R6

Page 1: ...April 2004 Autodesk MapGuide LiteView Developer s Guide ...

Page 2: ...Point RadioRay Reactor Revit Softdesk Texture Universe The AEC Authority The Auto Architect VISION Visual Visual Construction Visual Drainage Visual Hydro Visual Landscape Visual Roads Visual Survey Visual Toolbox Visual TugBoat Visual LISP Volo WHIP and WHIP logo The following are trademarks of Autodesk Inc in the USA and or other countries 3ds max AutoCAD Architectural Desktop AutoCAD Learning A...

Page 3: ...st 11 Example of a Minimal Map Request 12 Overview of map Request Parameters 13 Understanding map Request Parameters 15 Tips for Creating Map Requests 22 Creating a feature_info Request 22 Example of a feature_info Request 23 Positioning Feature Information 23 Understanding feature_info Request Parameters 24 Interpreting Responses to a feature_info Request 26 Sample Response 27 feature_info Respon...

Page 4: ...ication Files 56 ColdFusion Sample Application Requirements 57 ColdFusion Sample Application Client Platforms 57 Configuring the ColdFusion Sample Application 58 Starting the ColdFusion Sample Application 63 Removing the ColdFusion Sample Application Files 64 Using the ColdFusion Sample Application 64 Troubleshooting and Other Resources 77 Displaying Data by Layer 77 Designing the Recenter Feature...

Page 5: ...epen dent viewing solution for Autodesk MapGuide maps Deployed as a Java servlet Autodesk MapGuide LiteView serves interactive maps to most browsers map users don t have to download or install a viewer This chapter includes general information about this guide and its audience an overview of Autodesk MapGuide LiteView and its architecture and the general steps you that take to create an Autodesk M...

Page 6: ... is assumed to be installed in the default folder C Program Files Autodesk MapGuideLiteView6 5 some times abbreviated to InstallFolder What You Need to Know To get the most benefit from this guide and to develop a robust application you must be proficient in one or more of the following technologies or languages Active Server Pages ASP Java Server Pages JSP JavaScript scripting Perl scripting Serv...

Page 7: ...r use in your own work for example To copy text from a PDF file 1 Click the Text Select tool on the Acrobat Reader toolbar 2 Drag to select the text you want to copy 3 Right click and choose Copy from the shortcut menu The text is copied to the Clipboard Notations Used in Request Syntax Notation Description The argument or value is optional a b c A list of possibilities A grouping Typically used b...

Page 8: ...GetFeatureInfo requests to comply with the OpenGIS Web Map Service WMS 1 1 1 implementation specification You must register maps by using Autodesk MapGuide Lite View s WMS Administrator before making WMS 1 1 1 requests Features As a developer the Autodesk MapGuide LiteView features of special interest to you are User map interactivity You can use the following URL parameters in map requests to giv...

Page 9: ...image than it is to download and install a specialized viewer for image display Cross platform deployment Autodesk MapGuide LiteView responds to HTTP requests for MWF files by returning images in PNG or JPEG format Most Web browsers on most platforms support these formats natively Locked down deployment Many organizations prevent users from downloading and installing viewers such as ActiveX contro...

Page 10: ...and configure Autodesk MapGuide LiteView and the sample appli cations and then run a sample application to see how it works 2 Learn the HTTP requests that the Autodesk MapGuide LiteView servlet accepts For information about requests see Chapter 2 Understanding Requests on page 9 and Chapter 3 Making GetCapabilities GetMap and GetFeatureInfo Requests on page 35 3 Open a sample application source fi...

Page 11: ...s as a Java servlet container To fulfill a request for a raster image Autodesk MapGuide LiteView Accepts an HTTP request for a raster image of a portion of an MWF file Loads the requested MWF file Zooms to the correct location and scale generating HTTP requests for map layer data to the Autodesk MapGuide Server Returns a raster image in PNG or JPEG format as the HTTP response Web Server Autodesk M...

Page 12: ...8 Chapter 1 Introduction ...

Page 13: ...reting responses to a feature_info request 2 Understanding Requests This chapter gives an overview of requests and responses using Autodesk MapGuide LiteView and describes how to create requests for a map image and its feature informa tion and describes how to interpret a response that con tains feature information ...

Page 14: ...ion available at http www opengis org techno specs 01 068r3 pdf As an active and Principal Member of the Open GIS Consortium OGC Autodesk works with OGC staff and members to create industry stan dard mapping specifications for the Web The OGC Web site is at www opengis org This chapter describes how to make requests that comply with the draft WMS specification that is map and feature_info requests...

Page 15: ...ated with an ellipsis Prefix Represents the URL of the Autodesk MapGuide LiteView servlet http webserver_name context_path servlet MapGuideLiteView webserver_name is the name of the Web server under which Autodesk MapGuide LiteView is running followed by a colon and a port number context_path may or may not appear depending on your application server configuration The question mark at the end of t...

Page 16: ...dth Height rotationDegrees labelString SymbolName X Y Width Height rotationDegrees labelString Example of a Minimal Map Request The following example shows a map request that uses only required param eters for the map named Sample_World mwf http localhost 8080 liteview6 5 servlet MapGuideLiteView REQUEST map BBOX 26 117831 30 373481 49 340653 68 102723 WIDTH 600 HEIGHT 300 LAYERS Sample_World mwf ...

Page 17: ...of map Request Parameters The following table briefly describes the map request parameters that were introduced in Formatting a map Request on page 11 For detailed informa tion about these parameters see Understanding map Request Parameters on page 15 Note You must include all the following parameters in a map request except SELECT SRS HLS SYMBOLS and PPIY Parameters for map Requests Parameter Des...

Page 18: ...fail For more information see LAYERS Parameter on page 15 filename mwf A file name without drive folder or relative path FORMAT Required The format of the requested image PNG JPEG or JPG SELECT Optional A list of name value pairs The name portion of the pair is a map layer or map group name The value portion is the feature ID of the map feature that should be drawn in the selected state The map la...

Page 19: ...at are defined by the config ini file s own HLS parameter s Autodesk MapGuide Lite View assigns a default style if this parameter is omitted For more information about con fig ini s HLS parameter see Chapter 3 Con figuring Autodesk MapGuide LiteView in the Autodesk MapGuide LiteView Servlet Administrator s Guide An integer between 1 and 4 inclusive SYMBOLS Optional User defined symbols that identi...

Page 20: ...in the appro priate folder MyMap mwf MyMap reldir1 reldir2 MyMap In Windows you can t use the following characters in file names Note You can use the backslash as a path separator whether or not you enclose the MWF name in quotation marks Names that contain restricted char acters covered next must be enclosed in quotes Restricted Characters in the LAYERS Parameter You can t use the following chara...

Page 21: ...or group within the MWF followed by a comma and the feature ID as follows MwfName LayerNameInMWF feature ID MwfName LayerGroupNameInMWF feature ID If all the features are on the same layer or in the same layer group you don t have to repeat the second and subsequent names use a repeated comma delimiter instead of the names The following example specifies a map with two features selected from the r...

Page 22: ...amples in the following table The following example shows how you can enclose the layer name alone in quotation marks hudson_river mwf Rye NY 0044 If the MWF file name starts with a relative path you must enclose the entire path and MWF name in quotation marks The next example shows an MWF file name that includes a relative path In this example both the MWF file name and the layer name separately ...

Page 23: ...e XML 3 Create a map request by using the ID with the SELECT parameter to high light the feature and then send the request To see an example of how to create a map request see the ColdFusion sample application s map cfm page For more information about using the SELECT parameter see Under standing the Select And Identify Implementation on page 75 SRS Parameter If the SRS parameter appears in the ma...

Page 24: ... SYMBOLS Parameter Your application can use the SYMBOLS parameter to designate one or more map locations by using user defined symbols These locations can mark places of interest or a route s start or destination points for example Symbols which can differ by location have the following characteristics Symbol size is independent of map scale so a symbol s size is constant at any zoom level The sym...

Page 25: ...dministrator s Guide Specification Description Name The name of an Autodesk MapGuide API symbol If a symbol with the specified name is not found the default symbol a black square is displayed X Y The insertion point usually the center defined by the symbol By default the insertion point is specified in the coordinate sys tem used by the map MCS unless it is overridden by the SRS parameter If the X...

Page 26: ... Coordinates in the request must be in map coordinate system MCS units unless the SRS is set to ADSL LL84 in which case the coordinates must be latitude longitude All map request parameter values are case sensitive except the value of the REQUEST parameter Creating a feature_info Request You use a feature_info request in the HTTP get or post request of your appli cation to obtain feature informati...

Page 27: ...ication displays feature information in an appropriate location You match the LAYER BBOX WIDTH and HEIGHT values of the map request and feature_info request to display feature infor mation correctly In the ColdFusion sample application map cfm for example these values are set for Sample_World mwf as follows cfset mapName Sample_World mwf cfset defaultbbox 150 0 0 0 54 0 92 0 cfset width 500 cfset ...

Page 28: ...he first pair of floats specifies the lower left X Y coordinate and the second pair specifies the upper right X Y coordinate minX minY maxX maxY Floating point numbers WIDTH Required The width of the requested image expressed in pixels integer HEIGHT Required The height of the requested image expressed in pixels integer LAYERS Required The name of a registered MWF found in the search path specifie...

Page 29: ...set in the Y direc tion that identifies the feature of interest The upper left corner of map is at 0 0 Increase the value of Y to move down integer PPIY Not used The screen s vertical resolution expressed in pixels per inch This parame ter is not used from the map request but is taken from config ini or set to 72 by default An integer between 1 and 2147483647 inclu sive Feature_info Request Parame...

Page 30: ... text xml The following table describes the elements of a response Coordinate data is displayed only if the authored map references spatial data resources that are not password protected Note Multipolygons are returned with each boundary marked as an outerBoundary regardless of its relationship to other boundaries Response to a feature_info Request Element Attribute Setting FeatureCollection typeN...

Page 31: ...ndedBy Box srsName coordinates 0 0 0 0 4 0 4 0 coordinates Box boundedBy featureMember typeName FeatureInfoMember Feature typeName USA MWF Streets identifier F045 name Main Street name property typeName hyperlink type string http www mysite com scripts info cgi fid 01 property geometricProperty typeName geometry LineString coordinates 0 0 0 0 0 5 0 5 0 5 1 0 1 0 1 0 1 5 1 0 1 6 1 8 coordinates Lin...

Page 32: ... gmlgeometry dtd GMLGEOMETRYDTD A feature contains a set of properties simple and or geometric In addition a feature can optionally contain a description A feature must specify its feature type by name typeName It may optionally provide an identifier for use within its containing feature collection identifier ELEMENT Feature description name boundedBy property geometricProperty ATTLIST Feature typ...

Page 33: ...ATA REQUIRED Simple properties hold the property value as parsed character data The type of the value is specified by the type attribute which defaults to the string type The name of the property is specified by the typeName attribute ELEMENT property PCDATA ATTLIST property typeName CDATA REQUIRED type boolean integer real string string Geometric properties hold the property value as a contained ...

Page 34: ...oordinates decimal CDATA IMPLIED cs CDATA IMPLIED ts CDATA IMPLIED the Box element defines an extent using a pair of coordinates and a SRS name ELEMENT Box coordinates ATTLIST Box ID CDATA IMPLIED srsName CDATA REQUIRED G E O M E T R Y C L A S S D e f i n i t i o n s a Point is defined by a single coordinate ELEMENT Point coordinates ATTLIST Point ID CDATA IMPLIED srsName CDATA IMPLIED a LineStrin...

Page 35: ...iPoint pointMember ATTLIST MultiPoint ID CDATA IMPLIED srsName CDATA IMPLIED ELEMENT pointMember Point a MultiLineString is defined by zero or more LineStrings referenced through a lineStringMember element ELEMENT MultiLineString lineStringMember ATTLIST MultiLineString ID CDATA IMPLIED srsName CDATA IMPLIED ELEMENT lineStringMember LineString a MultiPolygon is defined by zero or more Polygons ref...

Page 36: ...hree descriptive names centerOf location and position ELEMENT pointProperty Point ELEMENT centerOf Point ELEMENT location Point ELEMENT position Point the lineStringProperty has two descriptive names centerLineOf and edgeOf ELEMENT lineStringProperty LineString ELEMENT centerLineOf LineString ELEMENT edgeOf LineString the polygonProperty has two descriptive names coverage and extentOf ELEMENT poly...

Page 37: ...perty has two descriptive names multiCoverage and multiExtentOf ELEMENT multiPolygonProperty MultiPolygon ELEMENT multiCoverage MultiPolygon ELEMENT multiExtentOf MultiPolygon ELEMENT geometryCollectionProperty GeometryCollection F E A T U R E M E T A D A T A D e f i n i t i o n s Feature metadata included in GML Geometry DTD for convenience name and description are two standard string properties ...

Page 38: ...34 Chapter 2 Understanding Requests ...

Page 39: ...Capabilities GetMap and GetFeatureInfo operations WMS specifies a URL syntax for producing maps on the Web from georeferenced data Developed by the Open GIS Consortium OGC WMS is a widely adopted open standard and is available at http www opengis org techno specs 01 068r3 pdf In this chapter Overview GetCapabilities requests GetMap requests GetFeatureInfo requests ...

Page 40: ...ly a hierarchical list of layers that the service supports A GetMap request returns a map image with well defined geospatial and dimensional parameters A GetFeatureInfo request returns information about a particular feature on a map Autodesk MapGuide LiteView supports GetCapabilities GetMap and GetFeatureInfo requests by implementing a WMS server and a WMS Admin istrator tool This chapter covers r...

Page 41: ...apabilities metadata and identi fies the source MWF or CDT capabilities document template from which Autodesk MapGuide LiteView takes the value For those values that come from an MWF file the table identifies the value s location in the MWF Parameter Name Comments VERSION Optional SERVICE Optional Must be WMS if present REQUEST Required Must be GetCapabilities or capabilities UPDATESEQUENCE Option...

Page 42: ...ContactOrganization CDT Editable value ContactPersonPrimary ContactPosition CDT Editable value ContactAddress AddressType CDT Fixed value Must be postal Address CDT Editable value City CDT Editable value StateOrProvince CDT Editable value PostCode CDT Editable value Country CDT Editable value ContactAddress ContactVoiceTelephone CDT Editable value ContactFacsimileTelephone CDT Editable value Conta...

Page 43: ... DCPType element content declaring support for both HTTP GET and POST For POST the body must be the same URL encoded key value pairs that can appear in GET requests GetCapabilities GetMap Format CDT Image format image png image jpeg or image jpg DCPType CDT Fixed DCPType element content declaring support for both HTTP GET and POST For POST the body must be the same URL encoded key value pairs that...

Page 44: ... POST For POST the body must be the same URL encoded key value pairs that can appear in GET requests GetFeatureInfo Request Exception Format CDT Fixed value Must be application vnd ogc se_xml Exception VendorSpecificCapabilities Not supported or included in the capabilities response UserDefinedSymbolization SupportSLD attribute CDT Fixed value Must be zero UserLayer attribute CDT Fixed value Must ...

Page 45: ...LatLonBoundingBox MWF Latitude longitude bounding box calculated from the map s latitude longitude center point and width height expressed in meters specified in the MWF file For arbitrary X Y coordinate systems this value can t be calculated and will be blank initially but should be entered by the administrator by using the WMS Administrator tool see Chapter 6 Working with the WMS Administrator T...

Page 46: ...e ScaleHint Not supported or included in the capabilities response for top level layers MWF files for example Layer this element is repeated for each layer in the MWF file Layer Groups are excluded Name MWF Name of the MWF file followed by a followed by the name from the layer attributes in the MWF file usa mwf States for example The Name value is encoded as Name Sample_World mwf 09World 20Cities ...

Page 47: ...erited from the parent layer MWF BoundingBox Bounding box of the individual layer This value usually is inherited from the parent layer MWF If an individual layer has its own SRS it also will have its own bounding box Dimension Not supported or included in the capabilities response Extent Not supported or included in the capabilities response Attribution Not supported or included in the capabiliti...

Page 48: ...dministrator can mention any gaps in the scale range in the Abstract field of the MWF file metadata section Layer Layer Capability Layer Attribute Comments cascaded Always set to zero fixedHeight Always set to zero fixedWidth Always set to zero noSubsets Always set to zero opaque Set to zero for a vector layer set to one for a raster layer queryable Top level layers MWF files have the queryable at...

Page 49: ...pecified as given in the GetCapabilities response If a layer name itself contains a comma a request will fail STYLES Must be empty STYLES also can be a comma separated list with the same number of elements as the LAYERS list Autodesk MapGuide LiteView will validate this list but not apply the styles SRS Identifier for the spatial reference system This value must match one of the values for the res...

Page 50: ...mage image png image jpeg or image jpg TRANSPARENT TRUE or FALSE For more information see Handling Transparency on page 46 BGCOLOR Background color 0xrrggbb where rrggbb is the hexadecimal representation of the desired RGB color EXCEPTIONS The default value is application vnd ogc se_xml TIME Optional Not supported in this release ELEVATION Optional Not supported in this release SLD Optional Not su...

Page 51: ...uest such as http localhost 8080 liteview6 5 servlet MapGuideLiteView REQUEST GetFeatureInfo VERSION 1 1 1 BBOX 26 117831 30 373481 49 340653 68 102723 WIDTH 600 HEIGHT 450 STYLES SRS EPSG 4326 LAYERS Sample_World FORMAT image png X 45 Y 189 QUERY_LAYERS Sample_World mwf For general information about request syntax see Formatting a map Request on page 11 GetFeatureInfo Request Parameters The GetFe...

Page 52: ...in the request If an MWF file not an individual layer is queried only one feature from the top most selectable layer is returned INFO_FORMAT Must be application vnd ogc gml 1 the default text xml or text html FEATURE_COUNT Optional parameter that is not supported in this release GetFeatureInfo in Autodesk MapGuide LiteView always returns information about a single feature X X coordinate of the poi...

Page 53: ...guring and Using the Sample Applications When you install Autodesk MapGuide LiteView the Setup program places two sample applications on your computer This chapter explains how the sample applica tions are designed describes how to configure and run them and describes how to use them as models for writ ing your own Autodesk MapGuide LiteView applications ...

Page 54: ... and displays maps published by Autodesk MapGuide LiteView and by other servers that comply with the OpenGIS Web Map Service WMS 1 1 1 implementation specifica tion WMS Viewer supports conventional navigation operations zoom pan recenter and manual bounding box adjustment and WMS GetCapabilities GetMap and GetFeatureInfo requests Through WMS Viewer s graphical user interface you can see which map ...

Page 55: ...w feature to it WMS Viewer s default location is C Program Files Autodesk MapGuideLiteView6 5 WmsViewer WMS Viewer is written in JavaScript HTML Java and JSP JavaServer Pages JSP is a server side process that creates an HTML page from a JSP source page A Web container processes the JSP source and displays the resulting HTML in a browser You can inspect the JSP source code in the file WmsViewer jsp...

Page 56: ...icon in WMS Viewer s images subfolder 2 Add an image link for contact jpg to the JSP page WmsViewer jsp so that the Contact icon appears to the right of the History icon The new code is shown here relative to the history jpg image img src images history jpg align absbottom a img src images contact jpg align absbottom The Contact icon here a cell phone image will appear next to the His tory icon as...

Page 57: ...Create the page ContactInfo html and place it in WMS Viewer s html sub folder This page must have seven fields one for each piece of contact information belonging to a form named ContactInfo and named name organization address city state telephone and email These fields are for dis play purposes only not user input 8 On the ContactInfo html page add the JavaScript function initContactInfo to fill ...

Page 58: ...dress document ContactInfo city value window opener contactCity document ContactInfo state value window opener contactState document ContactInfo telephone value window opener contactTelephone document ContactInfo email value window opener contactEmail script head body bgcolor FFFFFF text 000000 onload initContactInfo form name ContactInfo p Name input type text name name br Organization input type...

Page 59: ...allation comes with Apache Tomcat 3 3 1a and at your option Autodesk MapGuide LiteView Setup will install and configure Tomcat automatically to run with the WMS Viewer To set up Tomcat or a different application server manually see Chapter 5 Config uring Application Servers in the Autodesk MapGuide LiteView Servlet Admin istrator s Guide The ColdFusion Sample Application The ColdFusion sample appl...

Page 60: ...titude longitude coordinates regardless of the MCS ColdFusion Sample Application Files The ColdFusion sample application comprises the following server and client side files Java class and JavaScript scripts which make up a viewer and interface to Autodesk MapGuide LiteView ColdFusion templates The CFM files are the source code for frames of the sample application The map cfm template frame determ...

Page 61: ... Server Enterprise Edition is suitable You can t use ColdFusion Express Edition Autodesk MapGuide LiteView itself has additional software requirements see the Autodesk MapGuide LiteView Servlet Administrator s Guide ColdFusion applications are scripted pages and components When a client browser requests a page in a ColdFusion application the ColdFusion Server processes the scripting in the page es...

Page 62: ...d featureInfo cfm for your environment Check the MWFSearchPath in the Autodesk MapGuide LiteView servlet s config ini file to ensure that it is set to find the Sample_World mwf file Configure the ColdFusion Application Server to run ColdFusion under a user account Check that Autodesk MapGuide Server is running and start it if necessary Configuring the Java Settings You set the JVM and CFX Jar path...

Page 63: ...The ColdFusion Sample Application 59 To configure Java settings 1 Launch ColdFusion Administrator The ColdFusion Server Administrator screen is displayed JVM and Java Settings ...

Page 64: ...mes for the parseXml class and the Xalan and Xerces JAR files InstallFolder SampleApp classes InstallFolder SampleApp classes parseXml class InstallFolder SampleApp classes xerces jar InstallFolder SampleApp classes xalan jar 5 Check the location of the cfx jar file ColdFusion puts the JAR file in the following folder by default drive CFUSION Java classes 6 If the CFX Jar Path variable is not alre...

Page 65: ...th ColdFusion so ColdFusion can find the required DLL for processing the CFX tag in an appli cation page To register parseXml 1 Using ColdFusion Administrator Extensions category click CFX Tags to open the Registered CFX Tags page The CFX Tags screen is displayed 2 Click Register Java CFX The Add Edit Java CFX Tag screen is displayed 3 Set the case sensitive Tag Name to cfx_parseXml ...

Page 66: ...es 1 Using a text editor open the following file InstallFolder SampleApp map cfm 2 On line 9 replace the your server name tag with the name of the server on which Autodesk MapGuide LiteView is running for example cfset server MYSERVER 3 Save and close map cfm 4 Open the following file in a text editor InstallFolder SampleApp featureInfo cfm 5 On line 20 replace your SampleApp path with the path to...

Page 67: ... the access properties of the virtual directory to permit all access modes except write access 3 To start the ColdFusion sample application go to the following URL in a browser http webserver_name TestSample index htm where webserver_name denotes the name of your Web server By default IIS listens for connections on port 80 The browser displays the ColdFusion sample application form 4 Click a featu...

Page 68: ...parseXml tag in ColdFusion 5 Delete the virtual directory TestSample 6 Delete Autodesk MapGuide LiteView s SampleApp files and folders Using the ColdFusion Sample Application This section describes how to use the ColdFusion sample application as a model for your own Autodesk MapGuide LiteView applications The HTTP response to a request to start the sample application is an HTML form The form has t...

Page 69: ...request to Autodesk MapGuide LiteView cfif IsDefined MODE is True AND MODE EQ identify map cfm contains the image tag and the variable src is set to the request to insert the map image cfset maprequest http srvr servlet MapGuideLiteView REQUEST MAP FORMAT PNG HEIGHT height WIDTH width LAYERS mapName BBOX bbox src cfoutput maprequest cfoutput Note The variable srvr must include the web server name ...

Page 70: ... file see Chapter 3 Config uring Autodesk MapGuide LiteView in the Autodesk MapGuide LiteView Servlet Administrator s Guide The initial view that appears in the browser is from the Sample_World data set Setting the Default Bounding Box Autodesk MapGuide LiteView uses the default bounding box specified in map cfm to frame returned images cfset defaultbbox 150 0 0 0 54 0 92 0 At start up and when th...

Page 71: ...plates that are part of the sample application The templates encode the map and feature_info requests to Autodesk MapGuide LiteView The following excerpt from map cfm encodes the map request for example cfset maprequest http server servlet MapGuideLiteView REQUEST MAP FORMAT PNG HEIGHT height WIDTH width LAYERS mapName BBOX bbox Note The server variable must include the web server name and context...

Page 72: ...clicks a map to request feature information for example cfset urlRequest http Form server servlet MapGuideLiteView REQUEST feature_info HEIGHT Form height WIDTH Form width LAYERS Form mapName BBOX Form bbox X Form MAP X Y Form MAP Y Note The variable Form server must include the web server name and context path For a default Autodesk MapGuide LiteView installation Form server is localhost 8080 lit...

Page 73: ...d Understanding the ColdFusion Sample Application Map Request The following diagram shows the map request process The process steps shown in the diagram are 1 The browser opens a default application page MAP Y Required Y coordinate expressed in pixels of mouse click on the map image integer MODE Required Current mode of the application as determined by the toolbar button that the user clicks strin...

Page 74: ...ut input type hidden name MAPNAME value cfoutput mapName cfoutput input type hidden name WIDTH value cfoutput width cfoutput input type hidden name HEIGHT value cfoutput height cfoutput input type hidden name MODE value cfoutput mode cfoutput input type hidden name BBOX value cfoutput bbox cfoutput input type hidden name FEATURELAYER value cfoutput featureLayerName cfoutput input type hidden name ...

Page 75: ...ion page is loaded completely the onload tag calls the JavaScript function showMapSelected function showMapSelected layer id var selectFeatureRequest map cfm FEATURELAYER escape layer ID id BBOX cfoutput Form bbox cfoutput MODE identify parent map document location selectFeatureRequest body onload showMapSelected getLayer getId The function showMapSelected sends a request to map cfm which formulat...

Page 76: ... LiteView 5 The sample application sends the request 6 The sample application captures and stores XML 7 The sample application passes the XML file and XSL template file to parseXml the embedded Java class cfset xmlFile sampleAppPath xmlfilename cfset xslFile sampleAppPath featureInfo xsl CFX_parseXml XML xmlFile XSL xslFile 8 The parseXml class uses the Xerces and Xalan APIs to convert the XML int...

Page 77: ... throw new Exception FONT SIZE 4 COLOR Red Error FONT br B XML and XSL must be specified B String strXML request getAttribute XML String strXSL request getAttribute XSL Use XSLTProcessorFactory to instantiate an XSLTProcessor org apache xalan xslt XSLTProcessor processor org apache xalan xslt XSLTProcessorFactory getProcessor Create 3 objects for XSLTProcessor to do the transformation org apache x...

Page 78: ...iated with the mode executes each time the user clicks the map The button images show the user which mode is active The ColdFusion sample application uses JavaScript to swap images of the selected button so it appears to be available or unavailable The script sets a mode parameter in the get request to track which button the user clicked by submitting the get request to the CFM Then it sets the mo...

Page 79: ...tom embedded Java tag that represents the Java class uses the returned XML a style sheet variable and Xerces and Xalan parsers to cre ate an HTML stream of feature information This tag is contained by the featureInfo cfm file 5 The sample application embeds the feature information directly in the featureInfo cfm 6 The sample application loads featureInfo cfm and the unload tag calls the JavaScript...

Page 80: ...r the user is using and attach the appropriate stylesheet When the user clicks the Help button a URL opens and displays Help for the sample application in a new window The Help function executes once when the button is clicked Understanding the Zoom In Implementation When the user clicks the Zoom In button and then clicks the map the sample application zooms in on the map by a zoom factor of 2 The...

Page 81: ...e dif ferent You can implement the Recenter function as described in Designing the Recenter Feature on page 78 to solve this problem Autodesk MapGuide LiteView can t read the GML DTD while offline or behind a firewall You can use the FeatureInfoDTD parameter in the config ini file to point to the local GML DTD that Autodesk MapGuide LiteView Setup installs see Accessing the GML DTD While Offline o...

Page 82: ... The width and height parameters in a map request specify a rectangle of pixels into which Autodesk MapGuide LiteView should draw the resulting map The Recenter feature centers the bounding box within the image width and height To recenter correctly the ratio of the X to Y bounding box coor dinates must equal the ratio of the width to height of the image that is MCSx MCSy image_width image_height ...

Page 83: ...he effect of mismatched ratios change the ColdFusion sample appli cation so that it no longer recenters correctly 1 Open map cfm 2 Change the X coordinate of the maximum X of the bounding box from 54 to 108 as shown here cfset defaultbbox 150 0 0 0 108 0 92 0 3 Open the ColdFusion sample application page index htm 4 Click the Recenter tool to set Recenter mode and then click Mexico City The boundi...

Page 84: ...where the OpenGIS Geography Markup Language GML DTD is published Usually XML processors such as the one built into Microsoft Internet Explorer 5 and later can read this DTD file If the ColdFusion server that runs a sample application is running behind a firewall however the XML processor used by a sample application might not be able to access the DTD file and trigger a timeout error Note For info...

Page 85: ... LiteView Setup installs the file InstallFolder lite view CsToEpsgMap xml This file contains a mapping from ADSK xxxx to well known toolkit WKT strings You can extract these WKT strings and use them in your Autodesk MapGuide LiteView client applications to display WKT strings instead of ADSK xxxx codes The following example entry from CsToEpsgMap xml shows the mapping from ADSK UTM 49S to a WKT SR...

Page 86: ...mples general product documentation and discus sion groups Note The Autodesk MapGuide Viewer API is not used to develop Autodesk MapGuide LiteView applications About Other Autodesk MapGuide LiteView Sample Applications You ll find other Autodesk MapGuide LiteView sample applications on the Autodesk MapGuide Web site http www mapguide com sampleapps These applications include more features than do ...

Page 87: ...uttons As a user you select the Identify radio button and then click a room on the map Autodesk MapGuide LiteView returns feature information for the room and the Facilities Management application displays it in the browser About the Autodesk MapGuide LiteView Application Template You can download a template for developing Autodesk MapGuide LiteView applications from the Autodesk MapGuide Web site...

Page 88: ... Applications To use the application builder 1 Download the template files from the Autodesk MapGuide Web site 2 Map a virtual directory of your Web server to the template folder 3 In a browser navigate to the virtual directory and open start cfm ...

Page 89: ... following screen shows the default application and a sample world map Alternatively you can customize the application by modifying the file application cfm directly To customize the application manually 1 Using an HTML editor modify the application cfm file 2 Using a browser open the default htm page The application opens using the configuration values in application cfm ...

Page 90: ...86 Chapter 4 Configuring and Using the Sample Applications ...

Page 91: ...les 74 Java settings 58 map request 69 map request diagram 69 modifying CFM files 62 overview 55 registering XML parser 61 removing 64 removing files 64 requirements 57 starting 63 toolbar Zoom In 76 Zoom Out 76 toolbar implementation 74 toolbar Help 76 toolbar Re center 75 toolbar Select And Identify 75 toolbar UnZoom 76 use of JavaScript 74 using 64 XML 73 compliance with Web Map Service WMS 10 ...

Page 92: ...SP use with LiteView 2 Java servlets 4 Java settings 58 JavaScript use with LiteView 2 JavaScript used in ColdFusion sample application 74 JPEG 5 converting MWFs to 4 JVM Java Virtual Machine path setting 58 60 L layers displaying data by 77 for symbols 21 formatting names as request parameters 18 LAYERS parameter 15 restricted characters in 16 M map requests 10 ColdFusion sample application 69 Co...

Page 93: ...ture_info requests DTD 28 30 to map requests described 11 to requests overview 10 restricted characters in the LAYERS parameter 16 in the SELECT parameter 18 S sample applications ColdFusion 50 others available 82 WMS Viewer 50 sample response to feature_info request 27 Select And Identify implementation 75 SELECT parameter 17 using restricted characters in 19 selected map features highlighting 19...

Page 94: ...xtending 51 getting help 51 modifying 51 overview 50 starting 50 WMS See Web Map Service WMS X Xalan and Xerces 2 56 72 XML 61 72 XML parser 73 Java class 56 Z Zoom In implementation 76 Zoom Out implementation 76 ...

Reviews: