开发者

How do I increase the size of this map?

<!--
  copyright (c) 2009 Google inc.

  You are free to copy and use this sample.
  License can be found here: 

http://code.google.com/apis/ajaxsearch/faq/#license
-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="content-type" content="text/html; 

charset=utf-8" />
  <title>Google Visualization API Sample</title>
  <script type="text/javascript" 

src="http://www.google.com/jsapi"></script>
  <script type="text/javascript">
    google.load('visualization', '1', {packages: ['geomap']});

    function drawVisualization() {
      var data = new开发者_开发知识库 google.visualization.DataTable();
      data.addRows(6);
      data.addColumn('string', 'Country');
      data.addColumn('number', 'Popularity');

      data.setValue(1, 0, 'United 10:19 AM 8/16/2010States');
      data.setValue(1, 1, 300);
     var options = { region: 'us_metro' };

      var geomap = new google.visualization.GeoMap(
          document.getElementById('visualization'));
      geomap.draw(data, options);
    }


    google.setOnLoadCallback(drawVisualization);
  </script>
</head>
<body style="font-family: Arial;border: 0 none;">
<div id="visualization" style="width: 800px; height: 

400px;"></div>
</body>
</html>
​


Regarding GeoMap,this can help

  options['width']='800';
  options['height']= '600';
  geomap.draw(data,options);


To increase the size of the map visualization, you have to change the pixel values in the style attribute of <div id="visualization" ....

For example:

<body style="font-family: Arial;border: 0 none;">
<div id="visualization" style="width: 1600px; height: 800px;"></div>
</body>

Also, I noticed that you're using the Google Visualization API. Unless you're going to be showing some charts or creating an intensity or geo map, I recommend you use the Google Maps API - you can manipulate many more things about the map.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜