Generic Google Map Example with Markers

by Nibin George

HTML

<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?v=3&amp;sensor=false"></script>
<div id="Embeddedmap" class="mb">
                            <div class="panel no-margin">
                                <div class="panel-body">
                                    <div id="map_canvas" class="span12">
										
									</div>
                                </div>
                            </div>
                        </div>

CSS

#map_canvas {
   display: block;
   width: 100%;
   height: 200px;
}

JavaScript

window.onload = function () {
			var mapOptions = {
				//give latitude and long
				center: new google.maps.LatLng("29.362438", "47.962611"),
				zoom: 8,
				mapTypeId: google.maps.MapTypeId.ROADMAP
			};
			var infoWindow = new google.maps.InfoWindow();
			var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
				//give latitude and long
			var myLatlng = new google.maps.LatLng("29.362438", "47.962611");
			var marker = new google.maps.Marker({
				position: myLatlng,
				map: map,
				title: "Test Location here"
			});
		}