wiki:Cookbook/General/LaunchOptions

Version 2 (modified by pagameba, 17 years ago) ( diff )

--

Launch Options

When starting a Fusion application, you generally just type a URL to the template in the address bar of your browser and hit enter. Something like:

  • http://my.server.com/myapp/index.html

This starts up the application in its default state by loading the MapGroup specified in the MapWidget tag of the default ApplicationDefinition.xml file and shows the map at its default extent. However, you can specify some options when loading the application to override some of these defaults.

To pass new options to the Fusion application, you can add parameters to the URL as follows:

  • http://my.server.com/myapp/index.html?[option]=[value]

Several options can be added by separating them with an ampersand (&).

  • http://my.server.com/myapp/index.html?[option]=[value]&[option2]=[value2]

Tip: you don't need to include index.html in the URL.

  • http://my.server.com/myapp/?[option]=[value]

ApplicationDefinition

The ApplicationDefinition option allows you to specify a different ApplicationDefinition.xml file than the default. By default, Fusion will look for a file named ApplicationDefinition.xml in the same location as the index.html file. You may specify a URL to an ApplicationDefinition.xml file or, if you are using MapGuide, you may specify a Resource Identifier for an ApplicationDefinition resource located in your MapGuide repository (Library or Session).

Tip: if you are specifying a Resource Identifier to an ApplicationDefinition resource in a Session repository, you will also need to provide the Session option.

Examples:

  • http://my.server.com/myapp/?ApplicationDefinition=AlternateDefinition.xml
  • http://my.server.com/myapp/?ApplicationDefinition=Library://MyApp/MyApp.ApplicationDefinition

Session

The Session option allows you to force Fusion to use a specific session identifier when communicating with the server. This is very useful for integrating Fusion into an existing application where you have already established a user session with the server.

Tip: When using MapGuide, it makes it possible for a user to authenticate with MapGuide as part of another process and then launch a Fusion application with access to the resources granted to that user without requiring them to log in again.

Examples:

  • http://my.server.com/myapp/?Session=12345678
  • http://my.server.com/myapp/?ApplicationDefinition=Session:12345678//MyApp.ApplicationDefinition&Session=12345678

extent

The extent option allows you to pass in a different default extent for the initial map view. The value of the extent option is four floating point numbers separated by commas specifying, in order:

  • minimum x value
  • minimum y value
  • maximum x value
  • maximum y value

Example:

  • http://my.server.com/myapp/?extent=-76,45,-75,46
Note: See TracWiki for help on using the wiki.