[mapguide-users] Re: How to change Existing Max scale for a layer

SriRam007 binod_tripathy at yahoo.co.in
Mon Mar 1 02:07:56 EST 2010


Hi,

As u told to create a new MgLayer instance, and copy all the properties from
the original MgLayer to the new MgLayer. Then remove the original MgLayer
and insert the new one in the same position as the previous one.

I m doing like this.
Please tell me is there any wrong Showing error "An exception occurred in
the XML parser."

            String uniqueName = this.MakeUniqueLayerName(map, myLayerName);
            MgResourceIdentifier layerResId = new
MgResourceIdentifier("Session:" + Session["ID"].ToString() + "//" +
uniqueName + ".LayerDefinition");
            MgByteReader reader = new MgByteReader(layerDefinition,
"text/xml");
            resourceService.SetResource(layerResId, new
MgByteReader(layerDefinition, "text/xml"), null);
                        
            MgLayer newLayer = new MgLayer(layerResId, resourceService);
            newLayer.SetName(uniqueName);
            newLayer.SetLegendLabel(layer.GetLegendLabel());
            newLayer.SetDisplayInLegend(layer.GetDisplayInLegend());
            newLayer.SetVisible(true);
            newLayer.SetSelectable(layer.GetSelectable());
            layers.Insert(layers.IndexOf(layer), newLayer);
            newLayer.ForceRefresh();
            map.Save(resourceService, layerResId); //////Error Comming "An
exception occurred in the XML parser."


Here i am just replacing the new layer at the preveous layer's position


thanks


-- 
View this message in context: http://n2.nabble.com/How-to-change-Existing-Max-scale-for-a-layer-tp4637661p4652824.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list