To use the Wrapper on your web site, your web page links specify the mgmap.cfm file, passing the path to the MWF as a parameter and other optional parameters, such as a path to custom MapGuide API code. See Wrapper mgmap.cfm URL Parameters.
The Wrapper mgmap.cfm file passes all parameters to the map frame (mgmapframe.cfm) and from there to the map object or applet. The Wrapper accepts its own Wrapper parameters in addition to all MWF parameters defined by Autodesk, such as LAT, LON and WIDTH.
All paths values for path parameters (path, scriptpath, etc.) work just like paths in web page links. They may be relative to the Wrapper's installation directory, can start with / at the root of the site, or be a complete URL starting with the protocol and site name (http://gis.pima.gov/maps/...etc.).
http://gis.pima.gov/maps/mapguide/mgmap.cfm | Required path to Wrapper frameset. | |
?path=/maps/mapguide/dotmap65.mwf | Required path to an MWF file. Must be the first parameter. | |
&scriptpath=/maps/closures/closures.inc | Optional path to an include file that includes API code. | |
&appname=closures | Optional. mgmaptitleframe may use this application name to customize the title. | |
&LAT=31.984069&LON=-111.861927&WIDTH=189.931971&UNITS=mi | Any and all optional parameters allowed by the MapGuide Viewer. | |
When adding parameters to the mgmap.cfm URL, note that there should only be one question mark in the URL, just before the path= parameter which must be the first parameter. Like all URLs, subsequent parameters should be delimited with ampersands. When copying parameters from another map URL, such as the URL generated by right-click Copy…, Copy as URL in MapGuide, it's easy to make the mistake of copying and using the question mark from that URL. A leading question mark on any added parameter string should be changed to an ampersand.
http://gis.pima.gov/maps/mapguide/dotmap65.mwf
http://gis.pima.gov/maps/mapguide/mgmap.cfm?path=/maps/mapguide/dotmap65.mwf
Or, using a relative path to dotmap65.mwf which is in our Wrapper installation directory:
http://gis.pima.gov/maps/mapguide/mgmap.cfm?path=dotmap65.mwf
http://gis.pima.gov/maps/mapguide/mgmap.cfm?path=dotmap65.mwf&scriptpath=mgmapinitnullAPI.inc
Both dotmap65.mwf and mgmapinitnullAPI.inc are in our Wrapper's installation directory and therefore don't need more explicit paths. Unlike our site, it's probably better practice to keep your MWF's and other files separate from your Wrapper installation directory.
This example shows a complete URL (http://www... etc) as the value for the path parameter. We show this to show what's possible, not to suggest or imply that you should actually do this with another site's map! This particular map MWF file shown is from the Maricopa County Parcel Maps and displays their Pinal County map, despite that fact that it's shown with Pima County's title frame and controls.
Pima County MapGuide MWF Wrapper Main Page