<div dir="ltr">Hi,<br>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<br>
<br>$byteSource = new MgByteSource($layerDefinition, strlen($layerDefinition));<br>$byteSource->SetMimeType(MgMimeType::Xml);<br>$resourceId = new MgResourceIdentifier("Library://Samples/Sheboygan/Layers/RecentlyBuilt.LayerDefinition");<br>
$resourceService->SetResource($resourceId, $byteSource->GetReader(), null);<br>$map->Save($resourceService);<br><br>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.<br>
<br>With best regards,<br>Chandan<br><br>P.S.: I am using mapguide open source release 2.1 beta 1 and I am coding in PHP.
</div>