|
使用高德地图的模块(aMap)时候,,使用设置点击标注时弹出的气泡信息
(setWebBubble)时候遇到问题。
平台:安卓
代码片段:
- <script type="text/javascript">
- apiready = function () {
- vm.init();
- }
- var getWidth;//全局,获取宽度
- var vm = new Vue({
- el:'#cl',
- data: {
- },
- methods:{
- //---------------
- init: function(){
- getWidth =api.winWidth;
- var aMap = api.require('aMap');
- aMap.open({
- rect: {
- x: 0,
- y: 200,
- w: getWidth,
- h: '600'
- },
- showUserLocation: true,
- zoomLevel: 11,
- center: {
- lon: 116.4021310000,
- lat: 39.9994480000
- },
- fixedOn: api.frameName,
- fixed: true
- }, function(ret, err) {
- if (ret.status) {
- //alert(JSON.stringify(ret));
- } else {
- alert(JSON.stringify(err));
- }
- });
- aMap.addAnnotations({
- annotations: [{
- id: 1,
- lon: 116.402,
- lat: 39.999
- },{
- id: 2,
- lon: 116.412,
- lat: 39.999
- }, {
- id: 3,
- lon: 116.422,
- lat: 39.999
- }],
- icons: ['widget://'],
- draggable: true,
- timeInterval: 2.0
- }, function(ret) {
- if (ret.eventType == 'click') {
- aMap.setWebBubble({
- id:ret.id,
- size : {
- width:100,
- height:100
- },
- bg:'rgba(255,255,255,1)',
- //url:'http://img6.ph**.**',
- data:'<div class="aui-margin-r-15 aui-margin-l-15"><h2>这里是控制页<h2><feature name="aMap"><param name="android_api_key" value="f7Is0dWLom2q6rV3ZfFPZ1aa" /><param name="ios_api_key" value="81qz3dBYB5q2nGji4IYrawr1" /></feature></div>'
- });
- }
- });
- }
- } //------------
- });
- </script>
复制代码
问题描述:css使用的是aui,这段代码前面运行正常,地图可以正常显示,标注可以正常标注,直到点击标注时(调用setWebBubble)时候,不能正常显示data里面的html内容,只有我背景白框,具体请看下图,谢谢!!
[img]http://120.24.229.21/image/11.png[/img] |
|