API HW – Hsin-Ning Lee

Last week’s class was very helpful. I learned more about API. I also went to the review session on last friday.

For this assignment, I explored Google Maps API. I called the map and marked the exact location of Parsons.

Here is the link:

http://a.parsons.edu/~leeh578/map1.html

Below is my code:

<!DOCTYPE html>
<html>
<head>
<title>Google Map API</title>
<meta name=”viewport” content=”initial-scale=1.0, user-scalable=no” />
<style type=”text/css”>
html { height: 80% }
body { height: 80%; width: 80%; margin: 100; padding: 0 }
#map-canvas { height: 100% }
</style>
<script type=”text/javascript”
src=”https://maps.googleapis.com/maps/api/js?key=AIzaSyAPXmMRaQKWBzG37Y6SJUw4uO-adVxLTyw&sensor=false”&gt;
</script>
<script type=”text/javascript”>
function initialize() {

var mapOptions = {
center: new google.maps.LatLng(40.735257,-73.994424),
zoom: 16,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById(“map-canvas”),
mapOptions);

var marker = new google.maps.Marker({
position: map.getCenter(),
map: map,
title: ‘Parsons The New School for Design’
});

}
google.maps.event.addDomListener(window, ‘load’, initialize);
</script>
</head>
<body>
<br>
<h1>Parsons The New School for Design</h1>
<br>
<div id=”map-canvas”/>
</body>
</html>

Leave a comment

Filed under Homework

Leave a comment