I am having an issue with displaying a simple map from the Google Maps API in my HTML code. For some reason, the "map_canvas" div is initially set to be hidden when the page is loaded. Here is the code snippet:
<html>
<head>
<style type="text/css">
</style>
<script type="text/javascript" src="jquery-2.1.0.js"></script>
<script src="http://maps.googleapis.com/maps/api/js?" type="text/javascript"></script>
<script type="text/javascript">
var mapOptions = {
center: new google.maps.LatLng(-33.45, -70.66667),
zoom: 11,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
jQuery(document).ready(function(){
map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
});
</script>
</head>
<body>
body test
<div id="map_canvas">map test</div>
</body>
</html>
I added the text "map test" inside the div to check visibility. Any thoughts on why this might be happening?
Thank you.