0
我寫一個Xamarin Xamarin的iOS變色窗體應用程序,它實現了Android和iOS的自定義地圖渲染器。我想實現自定義引腳,其中不同的顏色在我的地圖上表示不同的東西。的一些地圖銷
我添加銷到我的自定義地圖的代碼是在這裏:
List<BasicMapAnnotation> annotationList = new List<BasicMapAnnotation>();
for (int i = 0; i < userLocations.Count; i++)
{
LatLong latLongs = JsonConvert.DeserializeObject<LatLong>(userLocations[i].coords);
var annotation = new BasicMapAnnotation(new CLLocationCoordinate2D(Convert.ToDouble(latLongs.latitude), Convert.ToDouble(latLongs.longitude)), userLocations[i].user_id, "Latitude: " + latLongs.latitude.ToString() + " Longitude: " + latLongs.longitude.ToString());
annotationList.Add(annotation);
}
nativeMap.AddAnnotations(annotationList.ToArray());
如何繪製我的腳時,我現在添加一些自定義登錄,使得它們是不同的顏色?
if(something())
{
annotation.colour = Color.Green;
}
你的意思是我應該可以使用類似annotation.PinTintColor的東西?因爲我不認爲註解有不幸 –
我添加代碼,以我的回答改變顯示在iOS上的腳色這樣的功能 - 從TK.CustomMap的iOS渲染採取 –
謝謝你,史蒂夫,如果是這樣的代碼中調用的自定義地圖渲染? –