[mapguide-users] MgTileService - GetTile - Cannot establish connection
Jason Birch
Jason.Birch at nanaimo.ca
Thu Dec 7 18:53:44 EST 2006
I'm surprised that there are methods which are available to the MapAgent
but not the APIs.
Was this a case of deliberate exclusion, or not enough time to get
everything in? I can see there being some arguments for not exposing
these methods (only need them for rendering, etc) but there are
apparently going to be some use cases for accessing them :)
Jason
________________________________
From: Walt Welton-Lair
Sent: Thursday, December 07, 2006 15:47
To: users at mapguide.osgeo.org
Subject: RE: [mapguide-users] MgTileService - GetTile - Cannot establish
connection
Sorry about that - I forgot that the Set methods weren't exposed.
As Alain mentioned, currently the only way to update the view is via
certain HTTP requests. GETMAP / GETMAPUPDATE / GETPLOT are used in the
context of DWFViewer, while GETMAPIMAGE and GETVISIBLEMAPEXTENT are used
in the context of AJAX Viewer. You can include additional parameters
with any of these requests to update view related information:
SETDISPLAYDPI=<dpi>
SETDISPLAYWIDTH=<width>
SETDISPLAYHEIGHT=<height>
SETVIEWSCALE=<scale>
SETVIEWCENTERX=<centerX>
SETVIEWCENTERY=<centerY>
While you can use a viewer to make these requests for you, you can make
the HTTP requests yourself and get the same effect. You could write an
application that:
1) creates a session
2) creates an MgMap for your MapDefinition that is part of your session
3) makes one of the HTTP requests above
- GETVISIBLEMAPEXTENT is the simplest
- include the SETVIEWSCALE parameter with the request to set the
scale you want
4) makes calls to GetTile
5) repeats steps 3 and 4 for each desired scale
For steps 1 and 2 there's should be sample code under the MgMap
documentation.
For step 3 something like .NET's HttpRequest class probably works. Just
make the request to your MG server, e.g.
http:://localhost/mapguide/mapagent?OPERATION=GETVISIBLEMAPEXTENT&VERSIO
N=1.0.0&SESSION=<sessionId>&MAPNAME=<mapName>&SETVIEWSCALE=<scale>
Here, mapName is the name from the MgMap.
Walt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20061207/bdd24d66/attachment.html
More information about the Mapguide-users
mailing list