शुभ दोपहर। अपने आवेदन में मैं parse.com पर मार्कर के लिए डेटाबेस से डेटा निकालने:मार्करों की एक सरणी बनाएं Google मानचित्र V2
public void ParseQueryMap() {
ParseQuery query = new ParseQuery("MyObject");
query.findInBackground(new FindCallback() {
public void done(List<ParseObject> myObject, ParseException e) {
if (e == null) {
for (int i = 0; i < myObject.size(); i++) {
commGet = myObject.get(i).getString("Comment");
geo1Dub = myObject.get(i).getParseGeoPoint("location").getLatitude();
geo2Dub = myObject.get(i).getParseGeoPoint("location").getLongitude();
Location aLocation = new Location("first");
aLocation.setLatitude(geo1Dub);
aLocation.setLongitude(geo2Dub);
Location bLocation = new Location("second");
bLocation.setLatitude(location.getLatitude());
bLocation.setLongitude(location.getLongitude());
int distance = (int)aLocation.distanceTo(bLocation);
if (distance<rad) { // where "rad" radius display points
myMap.addMarker(new MarkerOptions().position(new LatLng(geo1Dub,geo2Dub)).title(commGet) .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED)));
} else {
}
}
} else {
Toast.makeText(MainActivity.this, "Error!", Toast.LENGTH_SHORT).show();
}
}
});
मैं मार्करों इसके आकार का परीक्षण करने की एक सरणी बनाना चाहते हैं, और अगर यह शून्य है, तो AlertDialog दिखा। यही है, मैं जानना चाहता हूं कि मुझे कितनी गोलियां मिलीं। आपकी मदद के
अद्यतन के लिए धन्यवाद: मुझे पता है कि कितने चिह्न नक्शे
पर दिखाना चाहते हैं और समस्या है ....? –
जैसा कि आप सूची myObject की प्रत्येक प्रविष्टि के लिए मार्कर जोड़ रहे हैं, मुझे लगता है कि आपके पास myObject.getSize() मार्कर हैं। –
AlexVogel
myObject.getSize() डेटाबेस में रिकॉर्ड्स की संख्या दिखाता है। मेरी अपनी स्थिति और आधार के बिंदुओं के बीच की दूरी की गणना करना जारी रखने की योजना है, अब मुझे यह जानने की जरूरत है कि मेरे पास कौन सा मार्कर है, और क्या नहीं। –