| 244 | == !GetVisibleMapExtent ==#GetVisibleMapExtent2.0 |
| 245 | === Overview === |
| 246 | Returns the visible map extent in map coordinate system units for the map specified by SESSION and MAPNAME. !GetVisibleMapExtent in !MapGuide 2.0 is identical to [#GetVisibleMapExtent1.2 GetVisibleMapExtent in MapGuide 1.2] with the addition of a parameter to select either XML or JSON output for the result. The XML output has the following form: |
| 247 | {{{ |
| 248 | <?xml version=\"1.0\" encoding=\"UTF-8\"?> |
| 249 | <Envelope> |
| 250 | <LowerLeftCoordinate> |
| 251 | <X>10</X> |
| 252 | <Y>10</Y> |
| 253 | </LowerLeftCoordinate> |
| 254 | <UpperRightCoordinate> |
| 255 | <X>20</X> |
| 256 | <Y>20</Y> |
| 257 | </UpperRightCoordinate> |
| 258 | </Envelope> |
| 259 | }}} |
| 260 | And the JSON output has the following form: |
| 261 | {{{ |
| 262 | }}} |
| 263 | === Parameters === |
| 264 | || '''Name''' || '''Value''' || '''Required''' || '''Description''' || |
| 265 | || [#Operation1.0 OPERATION] || GETVISIBLEMAPEXTENT || Yes || Operation to execute || |
| 266 | || [#Version1.0 VERSION] || 2.0.0 || Yes || Operation version || |
| 267 | || [#Session1.0 SESSION] || session identifier || Yes || !MapGuide session identifier containing map to display. || |
| 268 | || [#MapName1.0 MAPNAME] || text || Yes || Name of the map to display.[[BR]]This corresponds to the !GetName() value for the resource identifier. || |
| 269 | || [#SetViewCenterX1.0 SETVIEWCENTERX] || double || Optional || Set X coordinate for center of map. || |
| 270 | || [#SetViewCenterY1.0 SETVIEWCENTERY] || double || Optional || Set Y coordinate for center of map. || |
| 271 | || [#SetViewScale1.0 SETVIEWSCALE] || double || Optional || Set scale for map. || |
| 272 | || [#SetDisplayDpi1.0 SETDISPLAYDPI] || integer || Optional || Set DPI for map. || |
| 273 | || [#SetDisplayWidth1.0 SETDISPLAYWIDTH] || integer || Optional || Set width of image in pixels. || |
| 274 | || [#SetDisplayHeight1.0 SETDISPLAYHEIGHT] || integer || Optional || Set height of image in pixels. || |
| 275 | || [#ShowLayers1.0 SHOWLAYERS] || text || Optional || List of layers to display. || |
| 276 | || [#HideLayers1.0 HIDELAYERS] || text || Optional || List of layers to hide. || |
| 277 | || [#ShowGroups1.0 SHOWGROUPS] || text || Optional || List of groups to display. || |
| 278 | || [#HideGroups1.0 HIDEGROUPS] || text || Optional || List of groups to hide. || |
| 279 | || [#OutputFormat2.0 FORMAT] || text || Optional || Desired output format. || |
| 280 | ==== FORMAT Parameter ====#OutputFormat2.0 |
| 281 | Selects the output format for the result: |
| 282 | * "text/xml" - Output is given in XML format |
| 283 | * "application/json" - Output is given in JSON format |
| 284 | === Usage === |
| 285 | {{{ |
| 286 | http://localhost/mapguide/mapagent/mapagent.fcgi?OPERATION=GETVISIBLEMAPEXTENT |
| 287 | &VERSION=1.0.0 |
| 288 | &SESSION=Session:d5d05422-5f75-102c-8000-02004c4f4f50_en_7F0000010AFC0AFB0AFA |
| 289 | &MAPNAME=WorldElevation |
| 290 | &SETVIEWCENTERX=-114.0 |
| 291 | &SETVIEWCENTERY=51.0 |
| 292 | &SETVIEWSCALE=50000 |
| 293 | &SETDISPLAYHEIGHT=500 |
| 294 | &SETDISPLAYWIDTH=500 |
| 295 | &FORMAT=application/json |
| 296 | }}} |
| 297 | Sets the center point of the !WorldElevation map to (-114,51) and the scale to 1:50000. The visible map extent is returned as JSON. The display height and width for a subsequent |
| 298 | [##GetDynamicMapOverlayImage1.2 GetDynamicMapOverlay] are set to 500 by 500. |