[mapguide-users] Modify mapdefinition in a layout

euskalmap ziburudebian at free.fr
Thu Mar 26 11:44:13 EDT 2009

Hi alucas,
you have very luck because it seems that i have problem in my C# code or perhaps in my configuration of mapguide server.

I provide the end user with a link to my special page (see the code1). In that page i redirect to the MapGuide viewer files (Response.Redirect).

The fonction SetLayout Map modify the mapdefinition in my layout. See image here :

The problem : the layout is not modify and i have this message : An exception occurred in the XML parser.
Have you an idea ?


this code works well for me (PHP):

function changeWebLayout($rs, $WebLayoutResId, $newMapResId, $s)
	     	 // Obtenemos el contenido del WebLayout en XML
		     $byteReader = $rs->GetResourceContent($WebLayoutResId);
		     $xml = $byteReader->ToString();
		     $doc = DOMDocument::loadXML($xml);
		     // Accedemos al nodo que queremos
		     $wl = $doc->getElementsByTagName("ResourceId"); 
		     $mapResIdNode = $wl->item(0);
		     $mapResIdNode->nodeValue = $newMapResId->ToString();
		     $strXML = $doc->saveXML();
				 //header('content-type: text/xml');
		     $byteSource = new MgByteSource($strXML, strlen($strXML));
		     // Modificamos el repositorio
		     $rs->SetResource($WebLayoutResId, $byteSource->GetReader(), null);
	    catch (MgException $e)
	    	echo $e->GetDetails();

View this message in context: http://n2.nabble.com/Modify-mapdefinition-in-a-layout-tp2462320p2539187.html
Sent from the MapGuide Users mailing list archive at Nabble.com.

More information about the mapguide-users mailing list