zoukankan      html  css  js  c++  java
  • map

    <!doctype html>
    <html>
    
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
        <title>我的位置</title>
        <link rel="stylesheet" href="https://a.amap.com/jsapi_demos/static/demo-center/css/demo-center.css" />
        <style type="text/css">
            html,
            body,
            #container {
                height: 100%;
            }
        </style>
    </head>
    
    <body>
        <div id="container"></div>
        <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.11&key=您申请的key值"></script>
        <script type="text/javascript">
            //初始化地图对象,加载地图
            var map = new AMap.Map('container', {
                resizeEnable: true
            });
            var options = {
                'showButton': true, //是否显示定位按钮
                'buttonPosition': 'LB', //定位按钮的位置
                /* LT LB RT RB */
                'buttonOffset': new AMap.Pixel(10, 20), //定位按钮距离对应角落的距离
                'showMarker': true, //是否显示定位点
                'markerOptions': { //自定义定位点样式,同Marker的Options
                    'offset': new AMap.Pixel(-18, -36),
                    'content': '<img src="https://a.amap.com/jsapi_demos/static/resource/img/user.png" style="36px;height:36px"/>'
                },
                'showCircle': true, //是否显示定位精度圈
                'circleOptions': { //定位精度圈的样式
                    'strokeColor': '#0093FF',
                    'noSelect': true,
                    'strokeOpacity': 0.5,
                    'strokeWeight': 1,
                    'fillColor': '#02B0FF',
                    'fillOpacity': 0.25
                }
            }
            AMap.plugin(["AMap.Geolocation"], function() {
                var geolocation = new AMap.Geolocation(options);
                map.addControl(geolocation);
                geolocation.getCurrentPosition()
            });
        </script>
    </body>
    
    </html>
  • 相关阅读:
    Python教程(2.2)——数据类型与变量
    Python教程(2.1)——控制台输入
    Python教程(1.2)——Python交互模式
    (译)割点
    Python教程(1.1)——配置Python环境
    Python教程(0)——介绍
    [HDU1020] Encoding
    [HDU1004] Let the balloon rise
    扩展中国剩余定理 exCRT 学习笔记
    51nod 1943 联通期望 题解【枚举】【二进制】【概率期望】【DP】
  • 原文地址:https://www.cnblogs.com/lldy/p/10116236.html
Copyright © 2011-2022 走看看