The digitizing functions in the Viewer API provide us with the digitized coordinates on the client, but we usually need to pass them to a server side script. This can be done with the Viewer API, using the Submit() method of the formFrame.
function OnLineDigitized(line) { // Send the Javascript variables to 'draw_line.php', // via the form frame var params = new Array("x0", line.Point(0).X, "y0", line.Point(0).Y, "x1", line.Point(1).X, "y1", line.Point(1).Y, "SESSION", "<?= $sessionId ?>", "MAPNAME", "<?= $mapName ?>"); parent.parent.formFrame.Submit( "/mapguide/samplesphp/digitizing_features/draw_line.php", params, "scriptFrame"); }
This submits the coordinates to the server-side function to draw the line. It uses the hidden scriptFrame so the page output is not visible.