[mapguide-users] Digitize point function Mapguide 2.1

John Bendix John.Bendix at ci.new-ulm.mn.us
Mon Oct 4 16:10:07 EDT 2010


Hello everyone,

I have figured out how to get the Digitize Point function to work in
mapguide, with the following code. By a selecting the screen with an
"onclick option" in java. 

But I need to post the results to another php, cfm, or whatever page to
submit the results to a mapguide layer or spatial table. Does anyone
know how or have an example of how this is done.

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

 

<html>

<head>

                <title>Untitled</title>

</head>

 

<body>

<script language="JavaScript">

                function getMapFrame() {

                                return top.Main.mapFrame;

                }

                

                function StartSelectPoint() {

                   getMapFrame().DigitizePoint(OnPointDigitized);

                   getMapFrame().document.body.style.cursor =
'crosshair';

                                

                }

                

                function OnPointDigitized(point) {

                                var x = point.X;

                                var y = point.Y;

 


                                

                                document.getElementById('x').value=x;

                                document.getElementById('y').value=y;

                                getMapFrame().document.body.style.cursor
= 'default';

 
ShowResults("X: " + point.X + ", Y: " + point.Y);

 


                  }

                

 


                                                                

                                                                 

                function ClearAddForm() {

                                document.getElementById('x').value="";

                                document.getElementById('y').value="";

                                getMapFrame().document.body.style.cursor
= 'default';

                }

                

                function RefreshMap() {

                   getMapFrame().Refresh();

                                                                   

                }

                                                                

                                                                

                                

                                                                

                                                                

                                                

 

</script>

 

<table width="100%">

                <tr>

                                <td align="right">

                                                <input
class="basicbutton" type="button" name="Add"

value=" Select Point on Map " onclick="javascript: StartSelectPoint();"

style="width=180;" />

                                                <br />

                                </td>

                </tr>

 

                <tr>

                                <td class="menu2">

                                                X Coordinate<br />

                                                <input type="text"
id="x" name="x" value=""

style="width:100%;" />

                                </td>

                </tr>

 

                <tr>

                                <td class="menu2">

                                                Y Coordinate<br />

                                                <input type="text"
id="y" name="y" value=""

style="width:100%;" />

                                </td>

                </tr>

 

                <tr>

                                <td align="right">

                                                <input
class="basicbutton" type="button"

id="clearbutton" value="Clear" style="width=106;" onclick="javascript:

ClearAddForm();" />

                                </td>

                </tr>

</table>

 

 

<hr />

 

<input class="basicbutton" style="display: block; float: right;"

type="button" name="refreshmapbutton" value=" Refresh Entire Map "

onclick="javascript: RefreshMap();" style="width=180;" />

 

 

 

</body>

</html>

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20101004/d42bf660/attachment.html


More information about the mapguide-users mailing list