Pima County MapGuide MWF Wrapper - Linking to the Wrapper and your MapGuide Map Pima County Geographic Information Systems logo

Pima County GIS - Pima County MapGuide MWF Wrapper

Linking to the Wrapper and your MapGuide Map

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.).

Example of Basic Wrapper URL Parameters


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.

Sample links

  1. Bare MWF - Not recommended! That's why we have the Wrapper.

    http://gis.pima.gov/maps/mapguide/dotmap65.mwf

  2. The same map using the base Wrapper

    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

  3. ...with our site's default API customization

    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.

  4. ...with standard MapGuide MWF parameters added

    http://gis.pima.gov/maps/mapguide/mgmap.cfm?path=dotmap65.mwf&scriptpath=mgmapinitnullAPI.inc&LAT=32.253132&LON=-110.789630&WIDTH=600&UNITS=ft

  5. Our site's Wrapper, title frame (saying "Pima County"), and default API customization with another site's MWF!

    http://gis.pima.gov/maps/mapguide/mgmap.cfm?path=http://www.maricopa.gov/Assessor/GIS/Maps/assessor.mwf&scriptpath=mgmapinitnullAPI.inc

    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.


Back button Pima County MapGuide MWF Wrapper Main Page