所以我想要做的是當用戶點擊一個Google地圖標記,一個活動會顯示,將顯示該標記內的所有信息。但問題是,所有標記都顯示相同的結果(這是我的parse.com數據庫第一行中的項目)。我目前正在使用Xamarin進行開發。我會很感激任何答案。先進的謝謝你們。Xamarin安卓 - 谷歌地圖標記始終顯示相同的信息
public async void getGeoPoint(){
string getPlaceName, getPlacePrice, getPlaceAddress, getOwnerContact, getRentalType, getOwnerName;
string xx = autoCompleteTextView.Text;
ParseQuery<ParseObject> query = ParseObject.GetQuery ("Rentals")
.WhereEqualTo ("rentalCity", xx);
IEnumerable<ParseObject> results = await query.FindAsync();
foreach(var temp in results){
getLatitude = temp.Get<double> ("rentalLatitude");
getLongitude = temp.Get<double> ("rentalLongitude");
getPlaceName = temp.Get<string> ("rentalName");
getPlacePrice = temp.Get<string> ("rentalPrice");
getPlaceAddress = temp.Get<string> ("rentalFullAddress");
getOwnerContact = temp.Get<string> ("ownerContactNo");
getRentalType = temp.Get<string> ("rentalType");
getOwnerName = temp.Get<string> ("ownerName");
myMarker = map.AddMarker(new MarkerOptions()
.SetPosition(new LatLng(getLatitude, getLongitude))
.SetIcon(BitmapDescriptorFactory.FromResource(Resource.Drawable.edimeow))
);
}
map.MarkerClick += (object sender, GoogleMap.MarkerClickEventArgs e) => {
string selected = getPlaceName;
var passToRentalProfile = new Intent (this, typeof(HostRentalProfileList));
passToRentalProfile.PutExtra ("selected", selected);
StartActivity (passToRentalProfile);
this.Finish();
};
btnList.Click += (object sender, EventArgs e) => {
var passToUserList = new Intent (this, typeof(UserListMode));
passToUserList.PutExtra("arrData", xx);
StartActivity(passToUserList);
this.Finish();
};
}//getGeoPoint