DesiDeglight
DesiDeglight fritst prototye
by vinayaknb
HTML
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<title>Google Maps Multiple Markers</title>//
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=places&sensor=false"></script>
</head>
<body>
<div id="map" style="width:600px; height:800px;"></div>
</body>
</html>
JavaScript
var map;
var latitude = 39.032969;
var longitude = -94.578019;
var accuracy = 100;
getCurrentGeoLocation();
function init() {
var locations = [
/* ['Royal hall',39.032836,-94.576413, 4],
['Student Union',39.034182,-94.581661, 5],
['Law School',39.033226,-94.58215, 3],
['Bloch School',39.033515,-94.581063, 2],
['Cherry Street',39.036222,-94.58182, 1],
['Arts and Sciences',39.036857,-94.578483,6],
['ISAO',39.036061,-94.576912,7],
['Miller Nichols',39.035365,-94.576456,8],
['Flarsheim Hall',39.034349,-94.576386,9],
['Parking structure',39.032149,-94.57637,10],
*/
];
map = new google.maps.Map(document.getElementById('map'), {
zoom: 10,
center: new google.maps.LatLng(latitude, longitude),
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var request = {
location: new google.maps.LatLng(latitude, longitude),
radius: 50000,
types: ['hindu_temple']
};
infowindow = new google.maps.InfoWindow();
var service = new google.maps.places.PlacesService(map);
service.nearbySearch(request, callback);
/* var infowindow = new google.maps.InfoWindow();
var marker, i;
for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
map: map
});
google.maps.event.addListener(marker, 'click', (function(marker, i) {
return function() {
infowindow.setContent(locations[i][0]);
infowindow.open(map, marker);
}
})(marker, i));
}
*/
}
function callback(results, status) {
//alert(status);
if (status == google.maps.places.PlacesServiceStatus.OK) {
for (var i = 0; i < results.length; i++) {
createMarker(results[i]);
}
}
...