NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

root/Chameleon/trunk/Chameleon/BoundingBoxPopup/BoundingBoxPopup.phtml

Revision 13 (checked in by jcleary, 17 years ago)

Latest Chameleon code checkout from previous repository

Line 
1 <?php
2 //set the language resource file
3 $szLanguageResource = str_replace("\\","/",dirname(__FILE__))."/BoundingBoxPopup.dbf";
4
5
6 // include the session handling file (currently only required for MLT)
7 include_once("../session.inc.php");
8 include_once("../CWC2ButtonCache.php");
9 ?>
10 <html>
11 <head>
12 <title><?php echo trim($oMLT->get("0", "Zoom to Coordinates")) ?></title>
13 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
14 <link href="<?php echo $szCSSFile; ?>" rel="stylesheet" type="text/css">
15 </head>
16 <script language="JavaScript" src="<?php echo $_SESSION['gszCoreWebPath']; ?>/widgets/js/cwc_dhtml.js" type="text/javascript"></script>
17 <script language="JavaScript" src="<?php echo $_SESSION['gszCoreWebPath']; ?>/widgets/js/cwc_button.js" type="text/javascript"></script>
18 <script language="JavaScript" type="text/javascript">
19 function applyZoomBox()
20 {
21     nMinX = document.forms[0].nMinX.value;
22     nMinY = document.forms[0].nMinY.value;
23     nMaxX = document.forms[0].nMaxX.value;
24     nMaxY = document.forms[0].nMaxY.value;
25
26     window.opener.applyBoundingBox( nMinX, nMinY, nMaxX, nMaxY );
27     window.close();
28 }
29
30 function applyZoomPoint()
31 {
32     nX = document.forms[0].nX.value;
33     nY = document.forms[0].nY.value;
34
35     window.opener.applyBoundingBox( nX, nY, "", "" );
36     window.close();
37 }
38
39 function updateCoordinates()
40 {
41     anCoords = window.opener.getMapExtents();
42     document.forms[0].nMinX.value = anCoords[0];
43     document.forms[0].nMinY.value = anCoords[1];
44     document.forms[0].nMaxX.value = anCoords[2];
45     document.forms[0].nMaxY.value = anCoords[3];
46     document.forms[0].nX.value = Math.min(anCoords[0], anCoords[2]) + ( Math.max(anCoords[0], anCoords[2]) - Math.min(anCoords[0], anCoords[2]))/2;
47     document.forms[0].nY.value = Math.min(anCoords[1], anCoords[3]) + ( Math.max(anCoords[1], anCoords[3]) - Math.min(anCoords[1], anCoords[3]))/2;
48
49     self.focus();
50 }
51
52 function CloseWindow()
53 {
54     window.close();
55 }
56 </script>
57 <body class="page" onLoad="updateCoordinates()">
58
59 <form>
60
61 <table border="0" cellpadding="1" cellspacing="10">
62   <tr>
63     <td class="layoutTable">
64       <table class="titleArea" width="100%" border="0" cellpadding="4" cellspacing="0">
65         <tr>
66           <td><img src="title_zoom_bbox.gif" width="22" height="22" align="texttop">&nbsp;<span class="title"><?php echo trim($oMLT->get("1", "Bounding Box Coordinates")) ?></span></td>
67         </tr>
68       </table>
69       <table class="contentArea" width="100%" border="0" cellpadding="4" cellspacing="0">
70         <tr>
71           <td align="center"><p class="helpArea"><?php echo trim($oMLT->get("2", "Please enter the coordinates of the bounding box (i.e. extents) of the area you wish to view.")) ?></p></td>
72         </tr>
73       </table>
74       <table class="contentArea" border="0" cellspacing="0" cellpadding="4" width="100%">
75         <tr>
76           <td>&nbsp;</td>
77           <td><span class="label"><?php echo trim($oCommonMLT->get("Max", "Max")) ?> Y</span><br>
78             <input class="inputBox" type="text" name="nMaxY" size="15">
79           </td>
80           <td>&nbsp;</td>
81           <td>&nbsp;</td>
82         </tr>
83         <tr>
84           <td><span class="label"><?php echo trim($oCommonMLT->get("Min", "Min")) ?> X</span><br>
85             <input class="inputBox" type="text" name="nMinX" size="15">
86           </td>
87           <td>&nbsp;</td>
88           <td><span class="label"><?php echo trim($oCommonMLT->get("Max", "Max")) ?> X</span><br>
89             <input class="inputBox" type="text" name="nMaxX" size="15">
90           </td>
91           <td>&nbsp;</td>
92         </tr>
93         <tr>
94           <td>&nbsp;</td>
95           <td><span class="label"><?php echo trim($oCommonMLT->get("Min", "Min")) ?> Y</span><br>
96             <input class="inputBox" type="text" name="nMinY" size="15">
97           </td>
98           <td>&nbsp;</td>
99           <td valign="bottom" align="right">
100             <?php echo makeButton( 'applyZoomBox', '', 'BoundingBoxPopup', 'images/icon_zoom.png', trim($oCommonMLT->get("Zoom", "Zoom")), trim($oCommonMLT->get("ZoomRectTip", "Zoom to Bounding Coordinates")), array( 'width' => 75 )); ?>
101           </td>
102         </tr>
103       </table>
104     </td>
105   </tr>
106   <tr>
107     <td class="layoutTable">
108       <table class="titleArea" width="100%" border="0" cellpadding="4" cellspacing="0">
109         <tr>
110           <td><img src="title_zoom_centre.gif" width="22" height="22" align="texttop">&nbsp;<span class="title"><?php echo trim($oMLT->get("4", "Point Coordinates")) ?> </span></td>
111         </tr>
112       </table>
113       <table class="contentArea" width="100%" border="0" cellpadding="4" cellspacing="0">
114         <tr>
115           <td align="center"><p class="helpArea"><?php echo trim($oMLT->get("5", "Please enter the coordinates of the location (i.e. point) you wish to view.")) ?></p></td>
116         </tr>
117       </table>
118       <table class="contentArea" width="100%" border="0" cellpadding="4" cellspacing="0">
119         <tr>
120           <td><span class="label"> X:</span>
121             <input class="inputBox" type="text" name="nX" size="15">
122           </td>
123           <td><span class="label">Y:</span>
124             <input class="inputBox" type="text" name="nY" size="15">
125           </td>
126           <td align="right" valign="bottom">
127             <?php echo makeButton( 'applyZoomPoint', '', 'BoundingBoxPopup', 'images/icon_zoom.png', trim($oCommonMLT->get("Zoom", "Zoom")), trim($oCommonMLT->get("ZoomPointTip", "Zoom to Point Coordinates")), array( 'width' => 75 )); ?>
128           </td>
129         </tr>
130       </table>
131     </td>
132   </tr>
133   <tr>
134     <td align="right">
135       <?php echo makeButton( 'CloseWindow', '', 'BoundingBoxPopup', 'images/icon_cancel.png', trim($oCommonMLT->get("Cancel", "Cancel")), trim($oCommonMLT->get("CancelTip", "Cancel Dialog")), array( 'width' => 75 )); ?>
136     </td>
137   </tr>
138 </table>
139
140 </form>
141
142 </body>
143 </html>
Note: See TracBrowser for help on using the browser.