1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- /* @var $this yii\web\View */
- $this->title = '房屋位置';
- use yii\helpers\Url;
- ?>
- <head>
- <meta charset="UTF-8">
- <title>位置</title>
- <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
- <link rel="stylesheet" href="http://cache.amap.com/lbs/static/main1119.css"/>
- <script type="text/javascript" src="http://webapi.amap.com/maps?v=1.3&key=210550b67bddb270e575a1838060f8ec&plugin=AMap.Autocomplete,AMap.PlaceSearch"></script>
- </head>
- <body>
- <div id="container" tabindex="0"></div>
- <script type="text/javascript">
- //基本地图加载
- var map = new AMap.Map("container", {
- resizeEnable: true,
- center: [<?=!empty($model->longitude)?$model->longitude:""?>,<?=!empty($model->latitude)?$model->latitude:""?>],//地图中心点
- zoom: 15 //地图显示的缩放级别
- });
- //添加点标记,并使用自己的icon
- new AMap.Marker({
- map: map,
- position: [<?=!empty($model->longitude)?$model->longitude:""?>,<?=!empty($model->latitude)?$model->latitude:""?>],
- icon: new AMap.Icon({ //自定义图标
- size: new AMap.Size(50, 50), //图标大小
- image: "/images/gd-icon.png"
- })
- });
- </script>
|