|
- <template>
- <view class="page">
- </view>
- </template>
- <script>
- export default {
- name: 'test',
- apiready(){//like created
- var aMap = api.require('aMap');
- aMap.open({
- rect: {
- x: 0,
- y: 0,
- w: 'auto',
- h: 'auto'
- },
- showUserLocation: false,
- zoomLevel: 18,
- fixedOn: api.frameName,
- fixed: true
- }, function(ret, err) {
- if (ret.status) {
- aMap.addAnnotations({
- annotations: [{
- id: 1,
- lon: 116.471764,
- lat: 40.018932,
- w: 25,
- h: 25
- }, {
- id: 2,
- lon: 116.29,
- lat: 40.109,
- w: 25,
- h: 25
- }, {
- id: 3,
- lon: 116.298,
- lat: 40.11,
- w: 25,
- h: 25
- }],
- //icons: ['widget://image/map_poi.png'],
- draggable: true,
- timeInterval: 2.0
- }, function(ret) {
- if (ret.eventType == 'click') {
- //alert(ret.id);
- }
- });
- //alert(JSON.stringify(ret));
- } else {
- //alert(JSON.stringify(err));
- }
- });
- },
- data() {
- return{
- }
- },
- methods: {
- }
- }
- </script>
- <style>
- .page {
- height: 100%;
- }
- </style>
复制代码 终于找到问题所在了
bug:
当showUserLocation=false的时候,标注会出现抖动
|
|