zoukankan      html  css  js  c++  java
  • Google Maps API3 之 Hello World

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

        <head>

            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

            <title>My first map</title>

     

            <style type="text/css">

                <!-- #map {

                    width: 100%;

                    height: 500px;

                    border: 1px solid #000;

                }

                -->

            </style>

     

            <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>

            <script>

                window.onload = function() {

                    // Creating a reference to the mapDiv

                    var mapDiv = document.getElementById('map');

                    // Creating a latLng for the center of the map

                    var latlng = new google.maps.LatLng(39.92, 116.46);

                    // Creating an object literal containing the properties

                    // we want to pass to the map

                    var options = {

                        center: latlng,

                        zoom: 10,

                        mapTypeId: google.maps.MapTypeId.ROADMAP

                    };

                    // Creating the map

                    var map = new google.maps.Map(mapDiv, options);

                }

            </script>

        </head>

     

        <body>

            <h1>My first map</h1>

            <div id="map"></div>

        </body>

     

    </html>

     

  • 相关阅读:
    php 3des加密 兼容JAVA 多么痛的领悟呀
    主机序和网络序
    不用递归实现无限分类数据的树形格式化
    python学习笔记之open函数的用法
    据说是百度面试题(1)
    YII+DWZ三级城市联动挂件
    wpf 报错: 在 AddNew 或 EditItem 事务过程中不允许“DeferRefresh”。
    MVVM了解
    纪念2015年上半年
    c# 委托与事件
  • 原文地址:https://www.cnblogs.com/my4piano/p/5326562.html
Copyright © 2011-2022 走看看