2017-02-18 89 views
0

的圖釘圖像大小我添加anntation這樣是否有可能調整註釋ti.map

var annot= Map.createAnnotation({ 
     latitude: XXXXXXXXXXX, 
     longitude: XXXXXXXXXX, 
     title: 'myPlace', 
     image: 'myPin.png', 
     width:'100dp',// doesn't work 
     height:'100dp'// doesn't work 
    }); 
    this.mapView.addAnnotation(annot); 
} 

我想雖然改變圖像的大小, 似乎沒有辦法改變。

所以我需要通過圖像編輯器或其他東西來編輯文件大小本身。 此外,Android或iPhone中的圖像顯示不同。 所以我需要爲每個針腳製作兩種尺寸。

回答

1
MapModule.createAnnotation({ 
    latitude : XXXX, 
    longitude : XXXX, 
    customView : Ti.UI.createView({ 
     width : widthImg, 
     height : heightImg * 2, 
     children : [Ti.UI.createView({ 
      top : 0, 
      width : width, 
      height : height, 
      backgroundImage : "myPin.png" 
     })] 
    }) 
}); 
+0

謝謝,'customView'效果不錯! – whitebear

相關問題