Hi everyone,
I am fairly new to web programming and I was wondering if anyone could
explain why I have the following problem with the demo code for Ymaps.
The issue I am having is that I can't get the map's width to spread
across the screen if I use the following doc type (it just produces a
square map half the size of the screen)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
Is there a preferred doctype to use with maps? Any wisdom would be
greatly appreciated
Thanks
-J
here is the code I used
<html>
<head>
<script type="text/javascript"
src="http://api.maps.yahoo.com/ajaxymap?v=3.7&appid=YahooDemo"></script>
<style type="text/css">
#map{
height: 75%;
width: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script type="text/javascript">
// Create a map object
var map = new YMap(document.getElementById('map'));
// Add map type control
map.addTypeControl();
// Set map type to either of: YAHOO_MAP_SAT, YAHOO_MAP_HYB, YAHOO_MAP_REG
map.setMapType(YAHOO_MAP_SAT);
// Display the map centered on a geocoded location
map.drawZoomAndCenter("San Francisco", 3);
</script>
</body>
</html>