[mapguide-users] Re: MG Maestro 4.0 HOW TO...

Jackie Ng jumpinjackie at gmail.com
Tue Nov 22 08:05:05 EST 2011


Here's a rough outline of API changes that relates to the particular code
sample you've given.

ServerConnectionI is now IServerConnection

Where ServerConnectionI was one big giant monolithic interface with hundreds
of methods, Maestro 4.0 splits this up into specific services (like the
official API)

IServerConnection has feature (IFeatureService) and resource
(IResourceService) service interfaces as builtin properties, additional
services can be retrieved via IServerConnection.GetService() 

All resource types (Feature Sources, Layer Definitions, Map Definitions,
etc) are now interfaces (IFeatureSource, ILayerDefinition, IMapDefinition,
etc) and all implement a root interface (IResource)

So something like this:

MapDefinition md = MGConn.GetMapDefinition(sb_mapdef.ToString());

Is now:

IMapDefinition md =
(IMapDefinition)MGConn.ResourceService.GetResource(sb_mapdef.ToString());

Use IEnvelope instead of Box2DType. If you need to create such instances,
use the ObjectFactory utility class.

We no longer allow manipulation of draw order in layers in a runtime map.
The layer's position in the RuntimeMap's layers collection *is* its draw
order. So re-ordering the draw order of layers is a matter of re-arranging
these layers in the layers collection. Layers and LayerGroups were
re-introduced into the 4.0 API as collections in a post-RC1 change. 

RuntimeMap has its own Save() method. So instead of this:

MGConn.SaveRuntimeMap(rtMapID, rtMap);

Just do this:

rtMap.Save();

To render maps you use the IMappingService interface. Instead of this:

Stream x = MGConn.RenderRuntimeMap(rtMapID, center[0], center[1],
scale_final, current_OVERALL_W, current_OVERALL_H, 96,
inputParam.RENDERMAPFORMAT);

To render the actual map is done like so:

IMappingService mapSvc =
(IMappingService)MGConn.GetService((int)ServiceType.Mapping);
Stream x = mapSvc.RenderRuntimeMap(rtMapID, center[0], center[1],
scale_final, current_OVERALL_W, current_OVERALL_H, 96,
inputParam.RENDERMAPFORMAT);


- Jackie

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/MG-Maestro-4-0-HOW-TO-tp7001682p7020334.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list