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

chandany5 chandany5 at gmail.com
Sat Aug 1 00:50:33 EDT 2009


Hi James,
Thank you for your quick reply. Can you tell me which API should I use to
modify the mapDefinitions. I tried many things but still I could not get the
layer appear on the map permanently.



James Card wrote:
> 
> On Fri, 31 Jul 2009 03:53:19 -0700, Chandan Kumar <chandany5 at gmail.com>  
> wrote:
> 
>> $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.
> 
> After you've saved your new layer definition you must then modify your  
> MapDefinition(s) so it includes your new layer. I posted some code to this  
> list last year that shows how this is done (sorry I don't have quick  
> access to that code, nor the mail archive, right now to find it again).
> 
> -- 
> James Card
> California CAD Solutions, Inc.
> 209-578-5580 - Voice
> 209-521-6493 - FAX
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
> 
> 

-- 
View this message in context: http://n2.nabble.com/Having-problem-in-adding-a-layer-to-the-map-permanently-tp3361903p3366463.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list