Welcome Guest, Not a member yet? Register   Sign In
using javascript and body onload
#1

[eluser]boony[/eluser]
Hi Guys,

Just a quick question. I'm trying to implement a google map function in my project. I'm just adding the javascript in the head section

Code:
[removed][removed]
    [removed]
      function initialize() {
        var latlng = new google.maps.LatLng(<?php echo $centerLat;?>, <?php echo $centerLng;?>);
        var myOptions = {
          zoom: 11,
          center: LatLng,
          mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        
        var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
    }
    
    [removed]
and then using
Code:
<body>

But for some reason the map is not loading. Other small tests indicate everything seems to be working ok so I got a feeling its not doing the body onload bit??? Any ideas??

Thanks


Messages In This Thread
using javascript and body onload - by El Forum - 09-15-2009, 10:06 AM
using javascript and body onload - by El Forum - 09-15-2009, 10:09 AM
using javascript and body onload - by El Forum - 09-15-2009, 10:10 AM
using javascript and body onload - by El Forum - 09-15-2009, 04:33 PM
using javascript and body onload - by El Forum - 09-15-2009, 10:44 PM



Theme © iAndrew 2016 - Forum software by © MyBB