[mapguide-users] Dynamic MapDefinition and Google Earth

Ivan Milicevic Ivan.Milicevic at supranet.hr
Mon Dec 31 09:49:11 EST 2007


Hi Michael,

 

I think that I have solution for your problem.

 

            //here, you create new connection to the mapguide server and
creates NEW mgSessionId

            MapGuideApi.MgInitializeWebTier(@"C:\program
files\MapguideOpenSource\WebServerExtensions\www\webconfig.ini");

            MgUserInformation userInfo = new
MgUserInformation("Administrator", "admin");

            MgSite site = new MgSite();

            site.Open(userInfo);

            String mgSessionId = site.CreateSession();

 

            MgUserInformation userInfoNew = new
MgUserInformation(mgSessionId);

            MgSiteConnection siteConnection= new MgSiteConnection();

            siteConnection.Open(userInfoNew);

 

            MgResourceService resourceSrvc
=(MgResourceService)siteConnection.CreateService(MgServiceType.ResourceS
ervice);

            MgMap map = new MgMap();
            //here, you specify a path to the NEW map

            MgResourceIdentifier resId = new
MgResourceIdentifier("Library://PROJEKTI/ZLZ/MAPE/ZDENCI.MapDefinition")
;

            String mapName = resId.GetName();

            map.Create(resourceSrvc, resId, mapName);

 

With this code you can change existing map in viewer.

Happy hollydays!

 

-----Original Message-----
From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Michael L.
Sent: Sunday, December 30, 2007 9:13 PM
To: mapguide-users at lists.osgeo.org
Subject: [mapguide-users] Dynamic MapDefinition and Google Earth

 

 

Hello,

 

I'd like to publish various layers from my map to Google Earth.
Therefore I

try to create

a dynamic map where all layers will be saved. This works so far, but for

some

reasons I'm not able to export my map to KML. 

The problem is what do I have to enter for MAPDEFINITION? 

 

header("Location:

http://localhost/mapguide2008/mapagent/mapagent.fcgi?OPERATION=GetMapKml
&VERSION=1.0.0&MAPDEFINITION=[?????????]&FORMAT=KML&LOCALE=de");

 

The static path 'Library://map/town_google.MapDefinition' is not working

because the map is only available during the session. I've already tried
to

use the MgSessionID, as well.

But then I got the Error, that this is no String.

It would be great if someone could help me.

 

Thanks in advance.

 

Michael

 

-- 

View this message in context:
http://www.nabble.com/Dynamic-MapDefinition-and-Google-Earth-tp14550671s
16610p14550671.html

Sent from the MapGuide Users mailing list archive at Nabble.com.

 

_______________________________________________

mapguide-users mailing list

mapguide-users at lists.osgeo.org

http://lists.osgeo.org/mailman/listinfo/mapguide-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20071231/545aecec/attachment.html


More information about the mapguide-users mailing list