[mapguide-users] capturing map image

Andy Morsell amorsell at spatialgis.com
Wed Nov 15 11:58:41 EST 2006


I just responded to this same question that you posted at the autodesk
MapGuide Enterprise discussion group.  More information on this can also be
found by searching the archives here.

-------------------------------------
The easiest way to do this would be to use the GETMAPIMAGE mapagent 
operation.  Here is an example URL:

http://localhost/mapguide/mapagent/mapagent.fcgi?OPERATION=GETMAPIMAGE&VERSION=1.0.0&MAPNAME=Sheboygan&LOCALE=en&MAPDEFINITION=Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition&FORMAT=PNG&SETDISPLAYDPI=300&SETDISPLAYWIDTH=800&SETDISPLAYHEIGHT=600&SESSION=6137915c-0000-1000-8000-005056c00001_en

In this case, the one thing you do need to determine or programatically 
create is a session.  That is required.  The above URL will return a map 
representation of how that map looked when the user last zoomed or panned, 
including any selected objects.  So, it's a good way to take an existing 
user map session and produce an image of what they were looking at.

There are some other optional override parameters so that you can set the 
map center, height and width without an existing session.  They are:

SETVIEWCENTERX=
SETVIEWCENTERY=
SETVIEWSCALE=

In this case, you don't need a SESSION parameter, but you will need to 
supply credentials.  You can use the below undocumented parameters so the 
user is not presented with the challenge/response dialog:

USERNAME=
PASSWORD=

Here is a full example:


http://localhost/mapguide/mapagent/mapagent.fcgi?OPERATION=GETMAPIMAGE&VERSION=1.0.0&MAPNAME=Sheboygan&LOCALE=en&MAPDEFINITION=Library%3A%2F%2FSamples%2FSheboygan%2FMaps%2FSheboygan.MapDefinition&FORMAT=PNG&SETVIEWCENTERX=-87.73&SETVIEWCENTERY=43.74&SETVIEWSCALE=5000&SETDISPLAYDPI=300&SETDISPLAYWIDTH=3000&SETDISPLAYHEIGHT=2100&USERNAME=Anonymous&PASSWORD=

Andy Morsell, P.E.
Spatial Integrators, Inc.
www.SpatialGIS.com


Kencana wrote:
> 
> hi all,
> 
> I got one question about exporting the map image into jpg or png or any
> image format file.Can I know how to do it?I hope somebody can help me
> out...thank you
> 
> regards,
> kencana
> 

-- 
View this message in context: http://www.nabble.com/capturing-map-image-tf2627292.html#a7361663
Sent from the MapGuide Users mailing list archive at Nabble.com.





More information about the Mapguide_users mailing list