-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
75 lines (61 loc) · 1.95 KB
/
test.html
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
<!-- WhistleBlower -->
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
#map_canvas { height: 100% }
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript">
</script>
<script type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=true">
</script>
<script type="text/javascript">
var map;
var marker;
var iWindow;
function submitMarker() {
$.ajax({
type: "POST",
url: "post",
data: { action: "addMarker",
location: marker.getPosition(),
type: "Unspecified",
urgency: 1,
notes: document.getElementById("notes").value},
success: function(responseText) {iWindow.close(); delete iWindow;}});
}
function createMarker(args) {
if (iWindow) {
iWindow.close();
delete iWindow;
}
marker = new google.maps.Marker({ position: args.latLng,
map: map,
title:"" });
iWindow = new google.maps.InfoWindow( { content: '<table>'+
'<tr><td>Comments:</td><td><input type="text" id="notes"></td></tr>'+
'<tr><td><input type="button" value="Enter" onClick="submitMarker()"></td></tr>'+
'</table>' } );
iWindow.open(map, marker);
}
function initialize() {
var latlng = new google.maps.LatLng(-34.397, 150.644);
var myOptions = {
zoom: 8,
center: latlng,
mapTypeId: google.maps.MapTypeId.SATELLITE
};
map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);
google.maps.event.addListener(map, 'click', createMarker);
}
</script>
</head>
<body onload="initialize()">
<div id="map_canvas" style="width:100%; height:100%"></div>
</body>
</html>