I have a web part that will get locations and then display the markers on a Google Map. For now I’m just trying to get a map to display on the page but that’s not even working. Here is the code I placed into the aspx file:
<div id="LocationWebPart">
<h3>Locations:</h3>
<hr />
<div id="LocationMap" style="width:250px;height:300;"></div>
<div id="locations">
</div>
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
<script src="/_layouts/website/scripts/gmap3.min.js" type="text/javascript" ></script>
<script type="text/JavaScript">
$(document).ready(function () {
$('#LocationMap').gmap3( {
actions: 'init',
options: {
center: [41.896254, -86.621529],
zoom: 11
}
});
});
</script>
</div>
When I run that in a test.html it works fine. Firebug also shows that the gmap3.min.js script is there.
Also, replacing $(document).ready() with _spBodyOnLoadFunctionNames.push() doesn’t do anything either
I found the answer. I forgot the
pxafterheight:300;">