2014-06-15 47 views
0

我需要在我的應用程序中使用谷歌地圖,我試過以下代碼來實現我的設計,但沒有運氣。Appcelerator鈦定製設計地圖視圖

這裏是我的代碼,

var anno = Titanium.Map.createAnnotation({ 
     title : "150$", 
     subtitle : "Its sub title", 
     latitude : 37.390749, 
     longitude : -122.081651, 
     title : "Appcelerator Headquarters", 
     subtitle : 'Mountain View, CA', 
     pincolor : Titanium.Map.ANNOTATION_RED, 
     image : "/images/MapPin.png", 
     animate : true, 
     leftButton : '/images/MapPin.png', 
     myid : 1 
    }); 

    var mapview = Titanium.Map.createView({ 
    borderColor : "red", 
    mapType : Titanium.Map.STANDARD_TYPE, 
    region : { 
    latitude : 37.390749, 
    longitude : -122.081651, 
    latitudeDelta : 0.01, 
    longitudeDelta : 0.01, 
    }, 
    animate:true, 
    regionFit:true, 
    userLocation:false, 
    annotations : [anno], 
    }); 

上面的代碼的結果,而不在其上標籤的標註,
Here is the design that i want to achieve
但我想用一些文字管腳上的標籤。
有人有什麼想法嗎?
在此先感謝。

+0

恐怕不可能把標題放在別針上。 –

回答

0

恐怕幾乎不可能把標題直接放在引腳上。但有一個更好的方法嘗試創建一個視圖以編程方式添加圖像,並在其上放置標籤,然後將該視圖轉換爲圖像並將其作爲PIN圖像..這是一種黑客攻擊,但很適合你。希望這可以幫助。