-
Notifications
You must be signed in to change notification settings - Fork 0
/
testmap03.html
80 lines (74 loc) · 2.58 KB
/
testmap03.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
<!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: 0; padding: 0 }
#map_canvas { height: 100% }
</style>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js">
</script>
<script type="text/javascript"
src="https://jquery-csv.googlecode.com/files/jquery.csv-0.71.min.js">
</script>
<script type="text/javascript"
src="http://maps.googleapis.com/maps/api/js?key=AIzaSyDxYsN5pBlnYn4noxdsLLWyo4QbI5XmLIE&sensor=false">
</script>
<script type="text/javascript">
// Enable the visual refresh
google.maps.visualRefresh = true;
var isochrone = new Object;
isochrone.map = null;
isochrone.circles = new Array;
isochrone.stops = null;
function initialize() {
isochrone.map = new google.maps.Map(document.getElementById("map_canvas"),{
center: new google.maps.LatLng(48.206829, 16.376324),
zoom: 12,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
console.log(isochrone.map);
var stopurl = 'http://data.wien.gv.at/daten/wfs?service=WFS&request=GetFeature&version=1.1.0&typeName=ogdwien:OEFFHALTESTOGD&srsName=EPSG:4326&outputFormat=json';
// var stopurl = 'haltestellen.json';
console.log("loading stops from " + stopurl);
$.ajax({
dataType: "json",
url: stopurl,
//data: null,
async: false,
}).done(function(stops) {
console.log(stops);
isochorone.stops = stops;
});
console.log(painting stops...);
$.each(isochrone.stops.features, function (index, stop) {
if (index > 100) { return; }
console.log(stop);
var circle = new google.maps.Circle({
clickable: false,
strokeColor: '#0000FF',
strokeOpacity: 0.8,
strokeWeight: 2,
fillColor: '#FF00FF',
fillOpacity: 0.35,
map: map,
radius: 100, // meter
center: new google.maps.LatLng(stop.geometry.coordinates[1],
stop.geometry.coordinates[0]),
visible: true,
zIndex: 1,
});
isochrone.circles.push(circle);
};
console.log("circles = " + circles.length);
console.log(map);
console.log("end initialize()");
} // end initialize()
</script>
</head>
<body onload="initialize()">
<div id="map_canvas" style="width:100%; height:100%"></div>
</body>
</html>