[mapguide-users] Having problem in adding a layer to the map permanently

Chandan Kumar chandany5 at gmail.com
Fri Jul 31 06:53:19 EDT 2009


Hi,
I am a newbie. I want to save a user created layer to the map permanently. I
am using the layer created by the code in "change_layers_via_dom.php" given
in the developer guide. It gives the layer of parcels which has been built
after 1980. Now I want to save this layer to the library and add this layer
to the map permanently. I am using the code

$byteSource = new MgByteSource($layerDefinition, strlen($layerDefinition));
$byteSource->SetMimeType(MgMimeType::Xml);
$resourceId = new
MgResourceIdentifier("Library://Samples/Sheboygan/Layers/RecentlyBuilt.LayerDefinition");
$resourceService->SetResource($resourceId, $byteSource->GetReader(), null);
$map->Save($resourceService);

This code successfully saves the new layer to the library but when I refresh
the page it no longer appears on the map I mean it does not adds this layer
to map permanently. Kindly tell me how can I get the layer appear on the map
permanently. It would be very helpful If someone could provide me some code
also.

With best regards,
Chandan

P.S.: I am using mapguide open source release 2.1 beta 1 and I am coding in
PHP.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20090731/511b09c4/attachment.html


More information about the mapguide-users mailing list