wordpress 高德地图代码生成器

自适应宽度

高德地图坐标拾取器: https://lbs.amap.com/console/show/picker

<style type="text/css">
    #container canvas{
        max-width: none;
    }
        #container{    
            height: 380px;    
            margin: 0px;    
            font: 12px Helvetica, 'Hiragino Sans GB', 'Microsoft Yahei', '微软雅黑', Arial;    
        }    
        .info-title{    
        color: white;    
        font-size: 14px;    
        background-color: #b00045;    
        line-height: 26px;    
        padding: 0px 0 0 6px;    
        font-weight: lighter;    
        letter-spacing: 1px    
        }    
        .info-content{    
        padding: 4px;    
        color: #666666;    
        line-height: 23px;    
        }    
        .info-content img{    
        float: left;    
        margin: 3px;    
        }    
</style>    
<div id="container" tabindex="0"></div>    
<div id='panel'></div>    
<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.3"></script>    
<script type="text/javascript">    
var map = new AMap.Map('container',{    
resizeEnable: true,    
zoom: 17,    
center: [121.452255,31.245114]    
});    
var marker = new AMap.Marker({    
position: [121.452255,31.245114]    
});    
marker.setMap(map);    
marker.on('click',function(e){    
infowindow.open(map,e.target.getPosition());    
})    
AMap.plugin('AMap.AdvancedInfoWindow',function(){    
infowindow = new AMap.AdvancedInfoWindow({    
content: '<div class="info-title">某某公司名称</div><div class="info-content">'+    
'电话:021-6381-0190<br />传真:021-6380-7605<br />地址:上海市闸北区长安路1001号长安大厦1号楼8层816-818室<br/>'+    
'</div>',    
offset: new AMap.Pixel(0, -30)    
});    
infowindow.open(map,[121.452255,31.245114]);    
})    
AMap.plugin(['AMap.ToolBar','AMap.Scale'],function(){    
var toolBar = new AMap.ToolBar();    
var scale = new AMap.Scale();    
map.addControl(toolBar);    
map.addControl(scale);    
})    
</script>

发表评论

登录

注册

重设密码

请输入您的用户名或电子邮箱地址。您会收到一封包含创建新密码链接的电子邮件。