zoukankan      html  css  js  c++  java
  • 高德地图——searchNearBy()

    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="utf-8">
            <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.11&key=9de88a718781910c9a1c81230827d1ce&plugin=AMap.Autocomplete,AMap.PlaceSearch"></script>
            <title>searchNearby</title>
            <style>
                *{
                    padding: 0;
                    margin: 0;
                    list-style: none;
                }
                #container{
                    position: absolute;
                    top: 0;
                    left: 0;
                     100%;
                    height: 100%;
                }
                #searchNode{
                    position: absolute;
                    z-index: 9;
                     300px;
                    height: 100px;
                    background: white;
                    text-align: center;
                    padding-top: 20px;
                }
                #setCenterNode{
                    position: absolute;
                    z-index: 9;
                     300px;
                    background: white;
                    top: 100px;
                }
            </style>
        </head>
        <body>
            <div id="container"></div>
            <div id="searchNode">
                <input type="" name="" id="searchInput" />
                <button id="btn">搜索</button>
            </div>
            <div id="setCenterNode"></div>
            
            <script>
                var map = new AMap.Map('container',{
                    zoom:10,
                    center:[116.379391,39.861536]
                });
                
                AMap.service(['AMap.PlaceSearch'],function(){
                    btn.onclick = function(){
                        new AMap.PlaceSearch({
                            type:'餐饮',
                            pageSize:5,
                            pageIndex:1,
                            city:'010',
                            citylimit:true,
                            map:map,
                            panel:'setCenterNode'
                        }).searchNearBy('',[116.379391,39.861536],200,function(){
                            
                        });
                    }
                });
    
            </script>
        </body>
    </html>

  • 相关阅读:
    分治策略
    uva 11424
    lightoj 1214
    lightoj 1282 && uva 11029
    lightoj 1341
    zoj 2369 Two Cylinders
    几种素数筛法
    lightoj 1245
    hdoj 1299 Diophantus of Alexandria
    求前n项正整数的倒数和
  • 原文地址:https://www.cnblogs.com/rickdiculous/p/11430309.html
Copyright © 2011-2022 走看看