[mapguide-users] Digitize point function Mapguide 2.1

Zac Spitzer zac.spitzer at gmail.com
Mon Oct 4 22:32:02 EDT 2010


add something like

document.location='report.cfm?x='+point.X +'&Y=' +point.Y';


or window.open(etc)

to the end of the OnPointDigitized function

On Tue, Oct 5, 2010 at 7:10 AM, John Bendix <John.Bendix at ci.new-ulm.mn.us>wrote:

>  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>
>
>
>
>
>
>
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
>


-- 
Zac Spitzer
Solution Architect / Director
Ennoble Consultancy Australia
http://www.ennoble.com.au
http://zacster.blogspot.com
+61 405 847 168
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20101005/e6186a05/attachment.html


More information about the mapguide-users mailing list