views:

28

answers:

1

I have a custom google map. It seems very simple.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml"&gt;
<head>
  <title></title>

  <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />

  <!--google magic-->
  <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"&gt;&lt;/script&gt;

  <!--custom map-->
  <script type="text/javascript">
    function initialize() {
      var latlngcenter = new google.maps.LatLng(41.523387, -87.691545);
      //move center west of marker to show I-57
      var myOptions = { zoom: 11, center: latlngcenter, mapTypeId: google.maps.MapTypeId.ROADMAP };
      var map = new google.maps.Map(document.getElementById("GardenWalk_Canvas"), myOptions);
      var latlng;
      var marker;
      latlng = new google.maps.LatLng(41.503387, -87.636545);
      marker = new google.maps.Marker({ position: latlng, map: map });
      latlng = new google.maps.LatLng(41.520935, -87.582318);
      marker = new google.maps.Marker({ position: latlng, map: map });
      latlng = new google.maps.LatLng(41.520075, -87.634509);
      marker = new google.maps.Marker({ position: latlng, map: map });
      latlng = new google.maps.LatLng(41.538092, -87.677964);
      marker = new google.maps.Marker({ position: latlng, map: map });
      latlng = new google.maps.LatLng(41.536256, -87.678006);
      marker = new google.maps.Marker({ position: latlng, map: map });
      latlng = new google.maps.LatLng(41.533099, -87.682250);
      marker = new google.maps.Marker({ position: latlng, map: map });
      latlng = new google.maps.LatLng(41.550018, -87.691408);
      marker = new google.maps.Marker({ position: latlng, map: map });
      latlng = new google.maps.LatLng(41.550017, -87.691305);
      marker = new google.maps.Marker({ position: latlng, map: map });
      latlng = new google.maps.LatLng(41.508768, -87.693976);
      marker = new google.maps.Marker({ position: latlng, map: map });
      latlng = new google.maps.LatLng(41.509065, -87.694586);
      marker = new google.maps.Marker({ position: latlng, map: map });
      latlng = new google.maps.LatLng(41.498524, -87.810122);
      marker = new google.maps.Marker({ position: latlng, map: map });
    }
  </script>

</head>
<body onload="initialize()">
  <div id="GardenWalk_Canvas" style="width: 500; height: 350" />
  text after
</body>
</html>

The only problem is that the map only shows when the following is removed:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

Any thoughts or rhyme or reason as to why?

+2  A: 

you have some comments in the html

//google magic
//custom map

which are not valid xhtml.

change it to

<!--google magic-->
Ji
oh, i just added that after the fact here, to separate and make some parts easier to read here on SO. They arn't in my release. I apologize for that.
Jim
Ok, I think i found your issue- missing "px".style="width: 500; height: 350"should bestyle="width: 500px; height: 350px"
Ji
That was it. It is usually the little things, and working on things late into the night with me. Thank you.
Jim