Map Control: overview, scale, toolbar

Map common controls: 
. 1, AMap.MapType: map widget types of handover for switching a fixed number of common layers 
2, AMap.OverView: Eagle map widget, default lower right corner of the map in the thumbnail display 
3, AMap.Scale: map scale plug 
4, AMap.ToolBar: map toolbar plug-ins can be used to control the map zoom and pan 

maps plugin adds: map.addControl (new AMap plug-in name ().)

 

 

 

<!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.Scale,AMap.OverView,,AMap.ToolBar,AMap.Autocomplete"></script>
        <title>地图控件:overview、scale、toolbar</title>
        <style>
            *{
                padding: 0;
                margin: 0;
            }
            #container{
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
            }
            #panel{
                position: fixed;
                background: white;
                top: 10px;
                right: 10px;
                width: 280px;
            }
            #search{
                width: 200px;
                height: 160px;
                position: absolute;
                left: 10px;
                top: 10px;
                background: white;
            }
        </style>
    </head>
    <body>
        <div id="container"></div>
        
        
        <script>
            var map = new AMap.Map('container',{
                zoom:11,
                center:[116.379391,39.861536],
                
            });
            
            map.addControl(new AMap.OverView());
            map.addControl(new AMap.Scale());
            map.addControl(new AMap.ToolBar());
        </script>
    </body>
</html>

 

Guess you like

Origin www.cnblogs.com/rickdiculous/p/11440457.html