= !MapGuide RFC 88 - AJAX Viewer support for custom initial view = This page contains an change request (RFC) for the !MapGuide Open Source project. More !MapGuide RFCs can be found on the [wiki:MapGuideRfcs RFCs] page. == Status == ||RFC Template Version||(1.0)|| ||Submission Date||22 March 2010|| ||Last Modified||Jackie Ng [[Timestamp]]|| ||Author||Jackie Ng|| ||RFC Status||ready for review|| ||Implementation Status||(pending, under development, completed)|| ||Proposed Milestone||2.2|| ||Assigned PSC guide(s)||(when determined)|| ||'''Voting History'''||(vote date)|| ||+1|||| ||+0|||| ||-0|||| ||-1|||| ||no vote|| || == Overview == This proposal is to extend the AJAX viewer to support a custom initial view, by simply passing additonal parameters to the Viewer URL. == Motivation == There have been many instances on the mapguide user mailing lists of the need to be able to load any given Web Layout with an initial view. Although code samples exist to show how this can be done. This is something that could be supported by the AJAX viewer out of the box, with some simple modifications. == Proposed Solution == Modify the AJAX viewer (all 3 languages) to accept the following 3 optional request parameters: * X: Specifies the X-coordinate of the custom view center. * Y: Specifies the Y-coordinate of the custom view center. * SCALE: Specifies the custom scale of the initial view. If any of these parameters are specified, they will be used instead of the values specified in the Web Layout document. Though the 3 parameters are optional, restrictions will be placed on how the viewer will accept these parameters: * If the X parameter is specified but the Y parameter isn't, the X parameter is ignored. Same applies vice versa. The web layout X/Y values are used instead. * The SCALE parameter can be specified without the X and Y parameters. The X and Y coordinates from the web layout will be used instead. * X and Y parameters can be specified without the SCALE parameter. The scale from the web layout will be used instead. == Implications == This is a client-side modification. No schema changes are required. No existing APIs are affected. No new APIs are added. == Test Plan == Verify all possible permutations of the 3 view parameters for all 3 viewers: * Custom X and Y will start the map at the specified point at the default scale. * Custom Scale will start the map at the default point at the specified scale. * Custom X, Y and Scale will start the map at the specified point and scale. * Any other illegal combinations are ignored and will use the default web layout values. == Funding/Resources == Community