Google Map API V3开发(2)

Google Map API V3开发(1)

Google Map API V3开发(2)

Google Map API V3开发(3)

Google Map API V3开发(4)

Google Map API V3开发(5)

Google Map API V3开发(6) 代码

3 Google Map API 简介

Google 地图 API 免费提供给用户并且适用于所有网站。Google 地图 API 使您能够使用 JavaScript 将 Google地图嵌入自己的网页中。API 提供了大量实用工具用以处理地图(正如 http://ditu.google.com 网页上的地图),并通过各种服务向地图添加内容,从而使您能够在您的网站上创建功能强大的地图应用程序。

4 帮助资源

?英文页面:

https://developers.google.com/maps/documentation/javascript/tutorial

这里有全部API接口介绍及示例。

?Google Maps Markers

http://mabp.kiev.ua/2010/01/12/google-map-markers/

这里是我找到的Google官方图标最全的地方了。直接复制图标URL到程序里即可使用。

5 Hello Google Map

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title>Google Maps API V3 Demo</title>

    <script type="text/javascript" src='http://maps.googleapis.com/maps/api/js?v=3&sensor=true&language=hk'></script>

    <script type="text/javascript">

          var map;

          function initialize() {

            var myOptions = {

                zoom: 13,

                center: new google.maps.LatLng(22.1623, 113.5552),

                mapTypeId: google.maps.MapTypeId.ROADMAP,

                scaleControl: true,

                scaleControlOptions: {

                    position: google.maps.ControlPosition.LEFT_BOTTOM

                }

            }

            map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

        }

    </script>

</head>

<body onload="initialize()">

    <div id="map_canvas" style=" 100%; height: 100%;"></div>

</body>

</html>

原文地址:https://www.cnblogs.com/jhlong/p/5394779.html