zoukankan      html  css  js  c++  java
  • Google Map 谷歌地图

        <script> 
            var map;
            function initMap() {            
                var position = new google.maps.LatLng(1.539187, 103.647115),
                                    
                map = new google.maps.Map(document.getElementById('map'), {
                    center: position,
                    zoom: 15, 
                    styles: [去网站弄]                
                });
             
                var marker = new google.maps.Marker({
                    position: position,
                    map: map,
                    animation: google.maps.Animation.DROP, // BOUNCE, DROP, lo, no              
                    icon: 'http://www.zoominn.com.my/i/ModuleMap_icon.png'                 
                });
                marker.addListener('click', function () {
                    var ttc = document.getElementById('mapContent').cloneNode(true);
                    var infoWindow = new google.maps.InfoWindow;
                    infoWindow.setPosition(position);
                    infoWindow.setContent(ttc);  //can put element but won't auto clone 哦
                    infoWindow.open(map);                    
                });          
            }
    
            var script = document.createElement('script');
            script.type = 'text/javascript';
            script.async = true;
            script.defer = true;
            script.src = 'https://maps.googleapis.com/maps/api/js?key=AIzaSyDzbTtAijGTrGdYxbU3FGuxnwwO3Vkmixg&callback=initMap'
            document.body.appendChild(script);
    
        </script>
        @*<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDzbTtAijGTrGdYxbU3FGuxnwwO3Vkmixg&callback=initMap" async defer></script>*@

    refer : 

    https://mapstyle.withgoogle.com/    (弄 style 的)

    https://developers.google.com/maps/ (官网)

  • 相关阅读:
    查看Android应用所需权限(uses-permission)
    Android Camera后台拍照
    傅里叶变换
    linux文件系统问题:wrong fs type, bad option, bad superblock
    H3 android 系统编译
    开源股票数据工具
    获取股票实时交易数据的方法
    获取历史和实时股票数据接口
    CRC在线计算工具
    硬盘自动挂载
  • 原文地址:https://www.cnblogs.com/keatkeat/p/6937767.html
Copyright © 2011-2022 走看看