[mapguide-users] Re: Add Mapguide layer to OpenLayers

Greg gbneff at cid.utah.gov
Tue Oct 4 11:03:08 EDT 2011


I wasn't sure about that and tried it both ways.  I am getting an
MGResourceNotFoundException so something else must be wrong.  This is the
request to the server:

http://localhost/mapguide/mapagent/mapagent.fcgi?USERNAME=Anonymous&PASSWORD=&mapName=Mapguide&session=93aee894-ee92-11e0-8000-485b394503be_en_7F0000010AFC0AFB0AFA&selectioncolor=0xFF000000&behavior=7&operation=GETDYNAMICMAPOVERLAYIMAGE&format=PNG&locale=en&clip=1&version=2.0.0&setdisplaydpi=96&setdisplayheight=1299&setdisplaywidth=1662&setviewcenterx=-12449910.02553&setviewcentery=4957889.3970753&setviewscale=144448.00544982313"

It looks OK to me, although I'm not sure where the "version=2.0.0" comes
from?  Maybe its a default that I need to override.  I am using MGOS 2.2
(32bit), OpenLayers 2.11, Win7 64bit

The mapName, sessionId and other info come from the server like this:

        MgUserInformation userinfo = new
OSGeo.MapGuide.MgUserInformation(defaultUser, defaultPassword);
        MgSite site = new MgSite();
        site.Open(userinfo);
        sessionId = site.CreateSession();
        
        MgUserInformation userInfo = new MgUserInformation(sessionId);
        MgSiteConnection siteConnection = new MgSiteConnection();
        siteConnection.Open(userInfo);
        
        MgResourceService resService =
(MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);
        MgResourceIdentifier resId = new MgResourceIdentifier(mapDef);
        MgMap map = new MgMap();
        map.Create(resService, resId, "Mapguide");
        mapName = map.GetName();
        LLX = map.GetMapExtent().GetLowerLeftCoordinate().GetX();
        LLY = map.GetMapExtent().GetLowerLeftCoordinate().GetY();
        URX = map.GetMapExtent().GetUpperRightCoordinate().GetX();
        URY = map.GetMapExtent().GetUpperRightCoordinate().GetY();

And are passed to my function, init(), which loads the map, like this:



--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Add-Mapguide-layer-to-OpenLayers-tp6841213p6858953.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list