-
Notifications
You must be signed in to change notification settings - Fork 0
/
map_anaf.php
89 lines (50 loc) · 1.7 KB
/
map_anaf.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
<?php $thesi = $row["geogr_thesi"]; ?>
<style>
#googleMap1 {
float:right;
width:400px;
height: 400px;
border-radius:10%;
border:3px solid black;
z-index:+9999;
}
#panel {
color:black;
position: absolute;
bottom: 285px;
left: 50%;
margin-left: -180px;
background-color: #fff;
padding: 0px;
border: 0px solid #999;
}
</style>
<script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyDY0kkJiTPVd2U7aTOAwhc9ySH6oHxOIYM&sensor=false">
</script>
<script>
//var LocationData = <?php echo $thesi; ?>
var LocationData = new Array(<?php echo '"',$thesi.'"';?>);
function initialize()
{
var mapOptions = {
maxZoom: 17
};
var map = new google.maps.Map(document.getElementById('googleMap1'), mapOptions );
var bounds = new google.maps.LatLngBounds();
var infowindow = new google.maps.InfoWindow();
var p = LocationData[0];
var stringcoor = p.replace(/[()]/g,'');
var commaPos = p.indexOf(',');
var coordinatesLat = parseFloat(stringcoor.substring(0, commaPos));
var coordinatesLong = parseFloat(stringcoor.substring(commaPos + 1, stringcoor.length));
var spot = new google.maps.LatLng(coordinatesLat, coordinatesLong);
bounds.extend(spot);
var marker = new google.maps.Marker({
position: spot,
map: map
});
map.fitBounds(bounds);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
<div class="map1" id="googleMap1"> </div>