Java web 中如何使用  google map 请指教!
Java web 中如何使用  google map 请指教!

解决方案 »

  1.   

    看看谷哥地图的API文档
    简单代码如下<html xmlns="http://www.w3.org/1999/xhtml">  <head>
        <title>谷哥地图代码</title>
        <meta http-equiv="Content-Type" content="text/html; charset=gbk" />
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
        <style type="text/css">
          html, body, #map_canvas {
            margin: 0;
            padding: 0;
            height: 100%;
          }
        </style>
       <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
        <script type="text/javascript">
          var map;
          function initialize() {
            var myOptions = {
              zoom: 8,
              center: new google.maps.LatLng(-34.397, 150.644),
              mapTypeId: google.maps.MapTypeId.ROADMAP
            };
            map = new google.maps.Map(document.getElementById('map_canvas'),
                myOptions);
          }      google.maps.event.addDomListener(window, 'load', initialize);
        </script>
      </head>
      <body>
        <div id="map_canvas"></div>
      </body>
    </html>
      

  2.   

    谢谢,呵呵,不好意思,才来看贴子,我找API了,也都实现功能了, 给分