[mapguide-users] Runtime map

Kenneth Skovhede, GEOGRAF A/S ks at geograf.dk
Thu Dec 4 07:36:33 EST 2008


If you are using the AJAX, DWF or Fusion viewer only,
you probably never want to create a runtime map.
The official viewers create the runtime map for you.
(and overwrite any you have created).

In that situation, you will need to load the current runtime map from 
the repository,
modify it, save it, and refresh the client.

You would the pass the SessionID to your ASPX code, and
open the connection using:
conn = new HttpServerConnection(host, sessionId, "en", True)

Then you will load the runtime map (delete the create call):

Dim rtMap As RuntimeClasses.RuntimeMap = conn.GetRuntimeMap(rtMapId)


Modify it, eg:
 rtMap.Layers(0).Visible = False

and Save it:
conn.SaveRuntimeMap(rtMap);


Then in javascript do:
GetMapFrame().Refresh();

Regards, Kenneth Skovhede, GEOGRAF A/S



padmini godavarthi skrev:
>
> Hi,
> iam using mapguide opensource 2.0(.net 2.0 +IIS 5.1).
> i saw the runtime map sample application in the url 
>
> http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI/samples/RuntimeMap
>
> according to the sample application i changed my code as
>
>
>                Dim host As New
> Uri("http://localhost/mapguide/mapagent/mapagent.fcgi")
>         Dim conn As New HttpServerConnection(host, "Administrator", "admin",
> "en", True)
>         Dim res As New ResourceIdentifier("Filebased data/Maps/mapdata",
> ResourceTypes.MapDefinition)
>         Dim mapId As String = res.ResourceId
>         Dim mapDef As MapDefinition = conn.GetMapDefinition(mapId)
>         Dim mapName As String = res.Name
>         Dim rtMapId As String = New ResourceIdentifier(mapName,
> ResourceTypes.RuntimeMap, conn.SessionID)
>         conn.CreateRuntimeMap(rtMapId, mapDef)
>         Dim rtMap As RuntimeClasses.RuntimeMap = conn.GetRuntimeMap(rtMapId)
>
> i didnt get this one
>
> 1) What i have to do with this?
> 2) What will be the output
>
> If anybody knows me can u plz tell me the procedure
>
>
> Regards,
> Padmini
>
>
>   


More information about the mapguide-users mailing list