-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathput_points.html
102 lines (88 loc) · 3.54 KB
/
put_points.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>День в городе 2009 — карта и маршруты</title>
<link href="common.css" rel="stylesheet" type="text/css" />
<link href="event.css" rel="stylesheet" type="text/css" />
<script src="http://maps.google.com/maps?file=api&v=2&sensor=true_or_false&key=ABQIAAAA4iMT6e1cHfPMjMaFvdWPWBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxReuuQ4S6Yz3mjkKpgvXdDE_znDqQ" type="text/javascript"></script>
<script type="text/javascript">
var MAP;
var MARKER;
var startPoint = new GLatLng(59.95,30.3166667);
function initialize() {
initMap();
}
function initMap() {
// MAP = new GMap2(document.getElementById("map"));
// MAP.setUIToDefault();
// MAP.setMapType(G_NORMAL_MAP);
// MAP.setCenter(startPoint, 16);
showAddress('Петропавловкая крепость');
}
var geocoder = new GClientGeocoder();
function showAddress(address) {
// if (MARKER) { MAP.removeOverlay(MARKER); }
// geocoder.getLatLng(
// address,
// function(point) {
// if (!point) {
// alert("\"" + address + "\" not found");
// } else {
// MAP.setCenter(point, 16);
// MARKER = new GMarker(point, {draggable: true});
//
// GEvent.addListener(MARKER, "dragend", function() {
// appendResult(MARKER);
// });
//
// MAP.addOverlay(MARKER);
// appendResult(MARKER);
// }
// }
// );
return false;
}
function appendResult(marker) {
var id = 'cp_' + document.getElementById('input_id').value;
if (!document.getElementById(id)) {
document.getElementById('coordinates').innerHTML += '<div id="' + id + '"></div>';
}
writeResult(marker.getPoint().lat(), marker.getPoint().lng(), id);
}
function writeResult(lat, lng, id) {
var s = '{ "id": ' + document.getElementById('input_id').value + ',<br/>';
s += '"name": "' + document.getElementById('input_name').value + '",<br/>';
s += '"task": "' + document.getElementById('input_task').value + '",<br/>';
s += '"coordinates": [' + lat + "," + lng + "]";
s += ' }, <br/>';
document.getElementById(id).innerHTML = s;
}
function updateResult() {
var curID = 'cp_' + document.getElementById('input_id').value;
writeResult(MARKER.getPoint().lat(), MARKER.getPoint().lng(), curID);
}
</script>
</head>
<body onload="initialize()" onunload="GUnload()">
<div id="all">
<div id="content">
<div id="left_panel">
<form onsubmit="return showAddress(document.getElementById('input_address').value)">
ID: <input type="text" id="input_id" /><br/>
NAME: <input type="text" id="input_name" onKeyUp="document.getElementById('input_address').value = document.getElementById('input_name').value" /><br/>
ADDRESS: <input type="text" id="input_address" /><br/>
TASK: <input type="text" id="input_task" /><br/>
<input type="submit" value="Find" />
<input type="button" value="Update" onclick="updateResult();"/>
</form>
<div id="coordinates"></div>
</div>
<div id="map_wrapper">
<div id="map"></div>
</div>
</div>
</div>
</body>
</html>