Hello.
Probably this is a known issue or I am doings something wrong. The
trouble is that map is not shown in IE8 if a DIV I supply to map
constructor was dynamically created.
Here is a simple testcase, it is minor modification of original
example: http://vinci.myxomop.com/ie8_dom_test.html
Works in FF and Chrome, but not in IE.
In case it is off line full code follows.
Thanks, A.
<html>
<head>
<script type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=false"></
script>
<script type="text/javascript">
var geocoder;
var map;
function initialize() {
geocoder = new google.maps.Geocoder();
}
function showlocation() {
var address = document.getElementById("address").value;
if (geocoder) {
geocoder.geocode( { 'address': address}, function(results,
status) {
if (status == google.maps.GeocoderStatus.OK) {
var out = document.getElementById("out");
var map_div = document.createElement("div");
map_div.setAttribute("style", "width:400px; height:
300px");
out.appendChild(map_div);
var myOptions = {
zoom: 12,
center: results[0].geometry.location,
mapTypeId: google.maps.MapTypeId.ROADMAP,
navigationControl: false,
mapTypeControl: false,
scaleControl: true
};
map = new google.maps.Map(map_div, myOptions);
} else {
alert("Geocode was not successful for the following reason:
" + status);
}
});
}
}
</script>
</head>
<body onload="initialize()">
<!-- <div id="map_canvas" style="width:800px; height:600px"></div> --
>
<div>
<input id="address" type="text"/>
<input type="button" value="Show" onclick="showlocation()"/>
</div>
<div id="out">
</div>
</body>
</html>
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.