Changes between Version 4 and Version 5 of maestro/MaestroAPI/samples/RuntimeMap
- Timestamp:
- 08/26/08 03:52:41 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
maestro/MaestroAPI/samples/RuntimeMap
v4 v5 1 1 2 == Utilizing RuntimeMap via Meastro API ==2 == Utilizing !RuntimeMap via Meastro API == 3 3 This page describes how to use the MaestroAPI from the [wiki:maestro MapGuide Maestro] project in your own application. 4 4 5 Just a quick one on creating and using RuntimeMaps via Meastro API. To get Meastro API going please download latest Meastro package, then reference OSGeo.MapGuide.MaestroAPI.dll and MapGuideDotNetApi.dll only. This example uses Maestro APIHttpServerConnection object which talks to the MG's mapagent.fcgi via HTTP. In other words - your code (i.e. ASP.NET page) may reside on remote computer calling MG server via HTTP.5 Just a quick one on creating and using !RuntimeMaps via Meastro API. To get Meastro API going please download latest Meastro package, then reference OSGeo.!MapGuide.MaestroAPI.dll and !MapGuideDotNetApi.dll only. This example uses Maestro API !HttpServerConnection object which talks to the MG's mapagent.fcgi via HTTP. In other words - your code (i.e. ASP.NET page) may reside on remote computer calling MG server via HTTP. 6 6 7 7 (VB.NET) … … 28 28 Dim mapName As String = res.Name 29 29 30 ' Now we decide on a name for our runtime map (stored in a Session)31 Dim rtMapId As String = "Session:" + conn.SessionID + "//" + mapName + ".Map"30 'Make a new ResourceIdentifier class to point to the runtime map in the session repository. 31 Dim rtMapId as String = new ResourceIdentifier(mapName, ResourceTypes.RuntimeMap, conn.SessionID) 32 32 33 33 ' Finally, we're telling HttpServerConnection to create runtime map … … 38 38 }}} 39 39 40 Having a reference to RuntimeMap enables us manipulating Library-resident map "clone" (see conn.CreateRuntimeMap) sitting in a Session. Don't forget - each MG Session may have different instance of RuntimeMap in it. When RuntimeMap is created, it's properties (including layers, layer visibility, etc.) is inherited from the originalMapDefinition. Let's change visibility of PARCELS layer initially being turned off:40 Having a reference to !RuntimeMap enables us manipulating Library-resident map "clone" (see conn.!CreateRuntimeMap) sitting in a Session. Don't forget - each MG Session may have different instance of !RuntimeMap in it. When !RuntimeMap is created, it's properties (including layers, layer visibility, etc.) is inherited from the original !MapDefinition. Let's change visibility of PARCELS layer initially being turned off: 41 41 42 42 {{{