Re[mapguide-users] turn all Layers from MapGuide repository
adnan.c
adnan.chughtai at keynetix.com
Fri Jun 13 05:38:39 EDT 2008
Thank you both for the helpful answers.
The Maestro API seems like a compelling solution that I will need to look
at.
Regards,
Adnan
Kenneth Skovhede, GEOGRAF A/S wrote:
>
> You can use the EnumerateResources function.
> I belive it is in the MgResourceService.
>
> Beware though, that the layers you show below are runtime map layers,
> whereas the layers in the repository are layerdefinitions.
> The layerdefinitions are all xml files.
>
> I have built an API that handles this Xml in a more accesible way:
> http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI/basics
>
> With MaestroAPI, you can get all the layers in the server with this code:
>
> MaestroAPI.ServerConnectionI connection = new
> MaestroAPI.LocalNativeConnection(configfile, username, password, locale);
> foreach(ResourceListResourceDocument doc in
> con.GetRepositoryResources("Library://", "LayerDefinition"))
> {
> LayerDefinition layer = connection.GetLayerDefinition(doc.ResourceId);
> if (layer.Item as VectorLayerDefinition != null)
> {
> string layerType = (layer.Item as VectorLayerDefinition).Geometry;
> }
> }
>
>
> Regards, Kenneth Skovhede, GEOGRAF A/S
>
>
>
--
View this message in context: http://www.nabble.com/Return-all-Layers-from-MapGuide-repository-tp17796701p17819820.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
More information about the mapguide-users
mailing list