-
Notifications
You must be signed in to change notification settings - Fork 0
/
zoomcoord.php
95 lines (86 loc) · 2.61 KB
/
zoomcoord.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>zoomcoord_php</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="StyleSheet" href="styles/popups.css" type="text/css" />
<link rel="stylesheet" href="styles/custom-theme/jquery-ui-1.8.6.custom.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" ></script>
<script type="text/javascript" src="javascript/jquery-ui-1.8.6.custom.min.js" ></script>
<style type="text/css">
/* <![CDATA[ */
.ui-widget {font-size: 11px;}
button {width: 100px;
margin: 20px;}
/* ]]> */
</style>
<script language="javascript" type="text/javascript">
/* <![CDATA[ */
$(function() {
$("button").button();
$("#rst").click(function(evt) {
evt.preventDefault();
document.forms.fm1.reset();
});
$('#sub').click(function (event) {
event.preventDefault();
var x = $('#x').val();
var y = $('#y').val();
var proj = $('input[name=projection]:radio:checked').val();
$.ajax({
type: "POST",
url: "zoomcoord_ajax.php",
data: { projection: proj, user_x: x, user_y: y },
dataType: "json",
success: function(data){
//alert(data);
$('#planex').val(data.x);
$('#planey').val(data.y);
$('#fm2').submit();
window.close();
}
});
});
});
/* ]]> */
</script>
</head>
<body >
<?php
$win_w = $_POST['win_w'];
$win_h = $_POST['win_h'];
$layer = $_POST['layers'];
?>
<p id="somecontent">To zoom to a particular point on the map viewer enter an x,y coordinate for the Albers
projection(meters) or longitude, latitude for geographic projection(decimal degrees).</p>
<form id="fm1">
<table>
<tr>
<td>x coordinate or longitude</td>
<td><input id="x" type="text" /></td>
</tr>
<tr>
<td>y coordinate or latitude</td>
<td><input id="y" type="text" /></td>
</tr>
<tr>
<tr>
<td>Projection:</td>
<td><input type="radio" name="projection" value="albers" checked="checked"/> Albers </td>
</tr>
<tr>
<td></td>
<td><input type="radio" name="projection" value="geograph" /> Geographic(DD) </td>
</table>
<button id="rst">Reset</button>
<button id="sub">Submit</button>
</form>
<form id="fm2" action="swgap/map.php" target="map" method="POST">
<input type="hidden" name="win_w" value="<?php echo $win_w; ?>"/>
<input type="hidden" name="win_h" value="<?php echo $win_h; ?>" />
<input type="hidden" name="layers" value="<?php echo $layer; ?>" />
<input type="hidden" name="user_x" id="planex" />
<input type="hidden" name="user_y" id="planey" />
</form>
</body>
</html>