I have been working with osmdroidbonus but with the example I have to display complete information like name and description. I want to display only the name not the description. And is it possible to store the value of mname in some variable ?
//Get OpenStreetMap content as KML with Overpass API:
OverpassAPIProvider overpassProvider = new OverpassAPIProvider();
BoundingBox oBB = new BoundingBox(startPoint.getLatitude() + 0.25, startPoint.getLongitude() + 0.25,
startPoint.getLatitude() - 0.25, startPoint.getLongitude() - 0.25);
String oUrl = overpassProvider.urlForTagSearchKml("amenity="+school, oBB, 100, 100);
boolean ok = overpassProvider.addInKmlFolder(mKmlDocument.mKmlRoot, oUrl);
if (ok) {
//13.1 Simple styling
Drawable defaultMarker = ResourcesCompat.getDrawable(getResources(), R.drawable.marker_kml_point, null);
Bitmap defaultBitmap = ((BitmapDrawable) defaultMarker).getBitmap();
Style defaultStyle = new Style(defaultBitmap, 0x911010AA, 50.0f, 0x20CC1010);
//13.2 Advanced styling with Styler
KmlFeature.Styler styler = new MyKmlStyler(defaultStyle);
FolderOverlay kmlOverlay = (FolderOverlay) mKmlDocument.mKmlRoot.buildOverlay(map, defaultStyle, styler, mKmlDocument);
map.getOverlays().add(kmlOverlay);
BoundingBox bb = mKmlDocument.mKmlRoot.getBoundingBox();
if (bb != null) {
//map.zoomToBoundingBox(bb, false); //=> not working in onCreate - this is a well-known osmdroid issue.
//Workaround:
setInitialViewOn(bb);
/* String a = mKmlDocument.mKmlRoot.mName;
Log.d(TAG,a);*/
}
}