URL Parameters

When you create a bookmark, you are simply saving the URL of the map with a set of parameters that indicate the map width, center point, and more. When you use a bookmark, Autodesk MapGuide Viewer reloads this URL with all the parameters that indicate exactly how to display the map.

If you know the URL of the map you want to view, and you know some of the values you want to use for particular parameters, such as the latitude/longitude of the center of the map, you can type them directly into the URL box in your browser, rather than manually moving the map. For example, if you know that the map name is amap.mwf and is located on www.mapguide.com, and you know the center point, map width, and map units, you could type the following URL:

http://www.mapguide.com/amap.mwf?Lat=-110.0&Lon=43.1&Width=100&Units=mi&ext=.mwf

The format of the URL should always be the URL of the map, followed by a question (?) mark, followed by the parameters you want to use (each separated by "&"), and lastly followed by "&ext=.mwf".

The following list shows all available URL parameters for Autodesk MapGuide Viewer. Default values are shown in bold. Parameters that include "Target" in their name accept reserved target names. See the Reserved Target Window Names table following the Parameter table.


Parameter Description
StatusBar Specifies whether to display the status bar.
[On | Off]
ToolBar Specifies whether to display the toolbar.
[On | Big | Off]
LayersViewWidth Specifies the width of the map layer legend in pixels. A value of zero completely hides the map layer legend. Default: 150
Lat Latitude of the center of the area to display. Specify the value in decimal degrees. You must use a period (.) as the delimiter, for example, "25.333333". This parameter works only when used with the Lon and Scale parameters, or with Lon, Width, and Units.
Lon Longitude of the center of the area to display. Specify the value in decimal degrees. You must use a period (.) as the delimiter, for example, "-45.888888".  This parameter works only when used with the Lat and Scale parameters, or with Lat, Width, and Units.
Width The width of the area displayed in Autodesk MapGuide Viewer using the units defined by the Units parameter. This parameter only works when used with the Lat, Lon, and Units parameters.
Scale Scale of the initial display, either a real or integer value. This parameter works only when used with the Lat and Lon parameters. If not specified, a scale that displays the entire map within the map window is selected automatically. This setting overrides the Width parameter, if specified.
Units Units used to specify the width. This parameter works only when used with the Lat, Lon, and Width parameters. [MI | KM | M | FT]
Selobjs Specifies a list of map features to select after Autodesk MapGuide Viewer is loaded and has displayed the map. The map features are identified by specifying the name of the layer that they are on, followed by their keys.
Syntax:
Selobjs=<MapLayer>,<Key_1>,...,<Key_N>
See examples below.
DefaultTarget Specifies the name of the target window where Autodesk MapGuide Viewer will display HTML documents, as well as URLs referenced in the OpenUrl and OpenMap actions. These actions can be defined when customizing the popup menu in Autodesk MapGuide Author. Default: _blank
ObjectLinkTarget Specifies the name of the target window where Autodesk MapGuide Viewer will display the URL associated with a map feature. Default: ObjectLink
ReportTarget Specifies the name of the target window where Autodesk MapGuide Viewer will display reports returned from the View > Report popup menu command. Default: Report
ErrorTarget Specifies the name of the target window where Autodesk MapGuide Viewer will display error messages. Default: Error
URLList Specifies whether Autodesk MapGuide Viewer should generate an HTML document that lists the names and links of the selected map features. The HTML document is displayed in the URLListTarget window whenever the user selects map features that have URLs associated with them.
[On | Off ]
URLListTarget Specifies the name of the target window where Autodesk MapGuide Viewer will display its URLList. Default: ObjectLink
AutoLinkLayers Specifies the name of a map layer that automatically displays map feature URL link information in the AutoLinkTarget window. The URLs are displayed in the AutoLinkTarget window.
AutoLinkTarget Specifies the name of the target window where Autodesk MapGuide Viewer will display the URLs downloaded from the AutoLinkLayers. Default: ObjectLink
AutoLinkDelay Specifies the number of seconds before the next URL associated with a map feature from an AutoLinkLayer will be displayed in the AutoLinkTarget window. Default value is 20. If 0 seconds is specified as the delay, the automatic timed update feature will be disabled, and the AutoLinkTarget window will be updated when the mouse passes over a map feature on an AutoLinkLayer.

Reserved Target Window Names

All of the target option parameters also accept the following reserved target window names:


Target Name Description
_blank Loads the link into a new blank browser window. The window has no name.
_parent Loads the link into the immediate parent of the window in which the link was clicked.
_self Loads the link into the same window as the one in which the link was clicked.
_top Loads the link into the full body of the window in which the link was clicked.

Examples

The following examples show map URLs with parameters added to them.

Downloading and Installing the Autodesk MapGuide ActiveX Control Automatically

When Web page authors add maps to their Web pages, they can also set up the pages so that the Autodesk MapGuide ActiveX Control is automatically downloaded and installed on your machine when you access those Web pages. If you use Microsoft Internet Explorer 5.x, the ActiveX Control will be installed in a folder named Downloaded Program Files under the Windows or Winnt folder.

Removing the Autodesk MapGuide ActiveX Control

Microsoft Internet Explorer 5.x provides an automated method for removing the Autodesk MapGuide ActiveX Control.

To remove the Autodesk MapGuide ActiveX Control

  1. Use Windows Explorer to navigate to the Downloaded Program Files folder.
  2. Click the Autodesk MapGuide ActiveX Control item in the folder, and then right-click and choose Remove from the popup menu.

    This deletes the file and removes it from your Windows Registry.

Updating the Autodesk MapGuide ActiveX Control

If you are using Microsoft Internet Explorer 5.x, you can automatically update the Autodesk MapGuide ActiveX Control.

To update the Autodesk MapGuide ActiveX Control

 
Customizing Autodesk MapGuide Viewer

Autodesk MapGuide Viewer exposes an API that allows you to develop highly specialized applications that can display and query maps for use on an intranet or the Internet. You can use JScript or VBScript to develop applications for Microsoft Internet Explorer, or use Java and JavaScript to develop applications for Netscape Navigator.

The documentation for the API, Autodesk MapGuide Viewer API Help, provides all of the information you need to begin developing applications. It describes the different features, methods, properties, and events in the API and includes several sample applications that you can use to get a quick start.