<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.5pt;
        font-family:Consolas;}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:Consolas;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=HR link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.0pt;
font-family:"Courier New"'>Hi Michael,<o:p></o:p></span></b></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.0pt;
font-family:"Courier New"'><o:p>&nbsp;</o:p></span></b></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.0pt;
font-family:"Courier New"'>I think that I have solution for your problem.<o:p></o:p></span></b></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.0pt;
font-family:"Courier New";color:red'><o:p>&nbsp;</o:p></span></b></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.0pt;
font-family:"Courier New";color:red'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; //here, you create new
connection to the mapguide server and creates NEW mgSessionId<o:p></o:p></span></b></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;</span></b><span style='font-size:9.0pt;
font-family:"Courier New";color:#2B91AF'>MapGuideApi</span><span
style='font-size:9.0pt;font-family:"Courier New"'>.MgInitializeWebTier(<span
style='color:#A31515'>@&quot;C:\program
files\MapguideOpenSource\WebServerExtensions\www\webconfig.ini&quot;</span><b>);</b><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></b><span style='font-size:9.0pt;
font-family:"Courier New";color:#2B91AF'>MgUserInformation</span><b><span
style='font-size:9.0pt;font-family:"Courier New"'> userInfo = </span></b><span
style='font-size:9.0pt;font-family:"Courier New";color:blue'>new</span><b><span
style='font-size:9.0pt;font-family:"Courier New"'> </span></b><span
style='font-size:9.0pt;font-family:"Courier New";color:#2B91AF'>MgUserInformation</span><b><span
style='font-size:9.0pt;font-family:"Courier New"'>(</span></b><span
style='font-size:9.0pt;font-family:"Courier New";color:#A31515'>&quot;Administrator&quot;</span><b><span
style='font-size:9.0pt;font-family:"Courier New"'>, </span></b><span
style='font-size:9.0pt;font-family:"Courier New";color:#A31515'>&quot;admin&quot;</span><b><span
style='font-size:9.0pt;font-family:"Courier New"'>);</span></b><span
style='font-size:9.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></b><span style='font-size:9.0pt;
font-family:"Courier New";color:#2B91AF'>MgSite</span><b><span
style='font-size:9.0pt;font-family:"Courier New"'> site = </span></b><span
style='font-size:9.0pt;font-family:"Courier New";color:blue'>new</span><b><span
style='font-size:9.0pt;font-family:"Courier New"'> </span></b><span
style='font-size:9.0pt;font-family:"Courier New";color:#2B91AF'>MgSite</span><b><span
style='font-size:9.0pt;font-family:"Courier New"'>();</span></b><span
style='font-size:9.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; site.Open(userInfo);</span></b><span
style='font-size:9.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></b><span style='font-size:9.0pt;
font-family:"Courier New";color:#2B91AF'>String</span><b><span
style='font-size:9.0pt;font-family:"Courier New"'> mgSessionId =
site.CreateSession();</span></b><span style='font-size:9.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;
font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></b><span style='font-size:9.0pt;
font-family:"Courier New";color:#2B91AF'>MgUserInformation</span><b><span
style='font-size:9.0pt;font-family:"Courier New"'> userInfoNew = </span></b><span
style='font-size:9.0pt;font-family:"Courier New";color:blue'>new</span><b><span
style='font-size:9.0pt;font-family:"Courier New"'> </span></b><span
style='font-size:9.0pt;font-family:"Courier New";color:#2B91AF'>MgUserInformation</span><b><span
style='font-size:9.0pt;font-family:"Courier New"'>(mgSessionId);</span></b><span
style='font-size:9.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></b><span style='font-size:9.0pt;
font-family:"Courier New";color:#2B91AF'>MgSiteConnection</span><b><span
style='font-size:9.0pt;font-family:"Courier New"'> siteConnection= </span></b><span
style='font-size:9.0pt;font-family:"Courier New";color:blue'>new</span><b><span
style='font-size:9.0pt;font-family:"Courier New"'> </span></b><span
style='font-size:9.0pt;font-family:"Courier New";color:#2B91AF'>MgSiteConnection</span><b><span
style='font-size:9.0pt;font-family:"Courier New"'>();</span></b><span
style='font-size:9.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; siteConnection.Open(userInfoNew);</span></b><span
style='font-size:9.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;
font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></b><span style='font-size:9.0pt;
font-family:"Courier New";color:#2B91AF'>MgResourceService</span><b><span
style='font-size:9.0pt;font-family:"Courier New"'> resourceSrvc =(</span></b><span
style='font-size:9.0pt;font-family:"Courier New";color:#2B91AF'>MgResourceService</span><b><span
style='font-size:9.0pt;font-family:"Courier New"'>)siteConnection.CreateService(</span></b><span
style='font-size:9.0pt;font-family:"Courier New";color:#2B91AF'>MgServiceType</span><span
style='font-size:9.0pt;font-family:"Courier New"'>.ResourceService);<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></b><span style='font-size:9.0pt;
font-family:"Courier New";color:#2B91AF'>MgMap</span><b><span style='font-size:
9.0pt;font-family:"Courier New"'> map = </span></b><span style='font-size:9.0pt;
font-family:"Courier New";color:blue'>new</span><b><span style='font-size:9.0pt;
font-family:"Courier New"'> </span></b><span style='font-size:9.0pt;font-family:
"Courier New";color:#2B91AF'>MgMap</span><b><span style='font-size:9.0pt;
font-family:"Courier New"'>();<span style='color:red'><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; //here, you specify a path to the NEW map</span></span></b><span
style='font-size:9.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></b><span style='font-size:9.0pt;
font-family:"Courier New";color:#2B91AF'>MgResourceIdentifier</span><b><span
style='font-size:9.0pt;font-family:"Courier New"'> resId = </span></b><span
style='font-size:9.0pt;font-family:"Courier New";color:blue'>new</span><b><span
style='font-size:9.0pt;font-family:"Courier New"'> </span></b><span
style='font-size:9.0pt;font-family:"Courier New";color:#2B91AF'>MgResourceIdentifier</span><b><span
style='font-size:9.0pt;font-family:"Courier New"'>(</span></b><span
style='font-size:9.0pt;font-family:"Courier New";color:#A31515'>&quot;Library://PROJEKTI/ZLZ/MAPE/ZDENCI.MapDefinition&quot;</span><b><span
style='font-size:9.0pt;font-family:"Courier New"'>);</span></b><span
style='font-size:9.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></b><span style='font-size:9.0pt;
font-family:"Courier New";color:#2B91AF'>String</span><b><span
style='font-size:9.0pt;font-family:"Courier New"'> mapName = resId.GetName();</span></b><span
style='font-size:9.0pt;font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><b><span style='font-size:9.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; map.Create(resourceSrvc, resId,
mapName);<o:p></o:p></span></b></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;
font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;
font-family:"Courier New"'>With this code you can change existing map in
viewer.<br>
<br>
Happy hollydays!<o:p></o:p></span></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText><span lang=EN-US>-----Original Message-----<br>
From: mapguide-users-bounces@lists.osgeo.org
[mailto:mapguide-users-bounces@lists.osgeo.org] On Behalf Of Michael L.<br>
Sent: Sunday, December 30, 2007 9:13 PM<br>
To: mapguide-users@lists.osgeo.org<br>
Subject: [mapguide-users] Dynamic MapDefinition and Google Earth</span><o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>Hello,<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>I'd like to publish various layers from my map to Google
Earth. Therefore I<o:p></o:p></p>

<p class=MsoPlainText>try to create<o:p></o:p></p>

<p class=MsoPlainText>a dynamic map where all layers will be saved. This works
so far, but for<o:p></o:p></p>

<p class=MsoPlainText>some<o:p></o:p></p>

<p class=MsoPlainText>reasons I'm not able to export my map to KML. <o:p></o:p></p>

<p class=MsoPlainText>The problem is what do I have to enter for MAPDEFINITION?
<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>header(&quot;Location:<o:p></o:p></p>

<p class=MsoPlainText>http://localhost/mapguide2008/mapagent/mapagent.fcgi?OPERATION=GetMapKml&amp;VERSION=1.0.0&amp;MAPDEFINITION=[?????????]&amp;FORMAT=KML&amp;LOCALE=de&quot;);<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>The static path 'Library://map/town_google.MapDefinition'
is not working<o:p></o:p></p>

<p class=MsoPlainText>because the map is only available during the session.
I've already tried to<o:p></o:p></p>

<p class=MsoPlainText>use the MgSessionID, as well.<o:p></o:p></p>

<p class=MsoPlainText>But then I got the Error, that this is no String.<o:p></o:p></p>

<p class=MsoPlainText>It would be great if someone could help me.<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>Thanks in advance.<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>Michael<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>-- <o:p></o:p></p>

<p class=MsoPlainText>View this message in context:
http://www.nabble.com/Dynamic-MapDefinition-and-Google-Earth-tp14550671s16610p14550671.html<o:p></o:p></p>

<p class=MsoPlainText>Sent from the MapGuide Users mailing list archive at
Nabble.com.<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>_______________________________________________<o:p></o:p></p>

<p class=MsoPlainText>mapguide-users mailing list<o:p></o:p></p>

<p class=MsoPlainText>mapguide-users@lists.osgeo.org<o:p></o:p></p>

<p class=MsoPlainText>http://lists.osgeo.org/mailman/listinfo/mapguide-users<o:p></o:p></p>

</div>

</body>

</html>