JS as follows:
(function() {
???? window. OnLoad = function() {
???????? //Creating an object literal containing the properties
???????? //We want to pass to the map
???????? var options = {
???????????? Zoom:
???????????? Center: New google.maps.LatLng (40.7257, -74.0047),
???????????? MapTypeId:google.maps.MapTypeId.ROADMAP
????????};
???????? //Creating the map
???????? var map = new google.maps.Map (document. getElementById (' map '), options);
???????? //Adding a marker to the map
????????
???????? //For New York, San Francisco, and Seattle
???????????? var places = [];
???????????? //Adding a Latlng object for each city
???????????????? Places.push (new google.maps.LatLng (40.756, -73.986));
???????????????? Places.push (new google.maps.LatLng (37.775, -122.419));
???????????????? Places.push (new google.maps.LatLng (47.620, -122.347));
?
?
???????????? //Looping through the places array
???????????????? for (var i = 0; I < places.length; I+ +) {
???????????????????? //Creating a new marker
???????????????????? var marker = new google.maps.Marker ({
???????????????????????? position: places[i],
???????????????????????? map: map,
???????????????????????? Title: ' Place number '+ i
????????????????????});
????????????????}
????};
})();
CSS as follows:
Body{
font-family< Span style= "COLOR: #38444b" >:verdana ,geneva , arial, helvetica,sans-serif;
Font-size:small;
Background:#fff;
}
#map{
Width:%;
Height:px;
Border:1pxsolid#000;
}
. info{
Width:+px;
}
?
HTML as follows:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" Content="text/html; Charset=utf-8 " />
<title>my first map</title>
<link type= "text/css" href=" Css/style.css " rel= "stylesheet" media=/>
<script Span style= "COLOR: #cb2d01" >type= "Text/javascript" src= "Http://maps.google.com/maps /api/js?sensor=false "></script >
<script type="Text/javascript" src="Js/map.js"></script>
</head>
<body>
<H1>my first map</H1>
<div id="Map"></div>
</body>
</html>
?
The effect is as follows:
How to add multiple tags to google Maps