diff --git a/app/src/main/java/de/apps4ics/mountainnavigation/MainActivity.java b/app/src/main/java/de/apps4ics/mountainnavigation/MainActivity.java index eb83059..8e30f92 100644 --- a/app/src/main/java/de/apps4ics/mountainnavigation/MainActivity.java +++ b/app/src/main/java/de/apps4ics/mountainnavigation/MainActivity.java @@ -409,28 +409,36 @@ title += " (" + fountainSizes[((Fountain) poi).getSize()] + ")"; break; case Types.PATH: { - Path p = (Path) poi; - DbGeoPoint pathEnd = p.getEndGp(); - title += " (" + p.getLength() + ")"; - Marker positionMarker = new Marker(mapView); - positionMarker.setPosition(new GeoPoint(pathEnd.getLat(), pathEnd.getLon(), pathEnd.getAlt())); - positionMarker.setAnchor(Marker.ANCHOR_CENTER, Marker.ANCHOR_BOTTOM); - positionMarker.setTitle(title); - positionMarker.setSnippet(snippetText); - positionMarker.setImage(res.getDrawable(entryImgs[getPos(type)])); - Drawable[] iconLayer = new Drawable[2]; - iconLayer[0] = res.getDrawable(R.mipmap.ic_poi); - BitmapDrawable bd = (BitmapDrawable) res.getDrawable(entryImgs[getPos(type)]); - if(bd == null) continue; - Bitmap b = bd.getBitmap(); - Bitmap bResized = Bitmap.createScaledBitmap(b, b.getWidth()/2, b.getHeight()/2, false); - bd = new BitmapDrawable(res, bResized); - bd.setGravity(Gravity.CENTER_HORIZONTAL); - iconLayer[1] = bd; - LayerDrawable icon = new LayerDrawable(iconLayer); - positionMarker.setIcon(icon); - result.add(positionMarker); - poiMarkers[getPos(type)].add(positionMarker); + Path p = (Path) poi; + DbGeoPoint pathEnd = p.getEndGp(); + title += " (" + p.getLength() + ")"; + snippetText += "\n"; + snippetText += "Exposed: " + ((p.getExposed() == 1) ? "Yes!" : "No!"); + snippetText += "\n"; + snippetText += "Difficult: " + ((p.getDiffWet() == 1) ? "Yes!" : "No!"); + snippetText += "\n"; + snippetText += "Giddiness: " + ((p.getGiddiness() == 1) ? "Yes!" : "No!"); + snippetText += "\n"; + snippetText += "Climbing: " + ((p.getClimbing() == 1) ? "Yes!" : "No!"); + Marker positionMarker = new Marker(mapView); + positionMarker.setPosition(new GeoPoint(pathEnd.getLat(), pathEnd.getLon(), pathEnd.getAlt())); + positionMarker.setAnchor(Marker.ANCHOR_CENTER, Marker.ANCHOR_BOTTOM); + positionMarker.setTitle(title); + positionMarker.setSnippet(snippetText); + positionMarker.setImage(res.getDrawable(entryImgs[getPos(type)])); + Drawable[] iconLayer = new Drawable[2]; + iconLayer[0] = res.getDrawable(R.mipmap.ic_poi); + BitmapDrawable bd = (BitmapDrawable) res.getDrawable(entryImgs[getPos(type)]); + if(bd == null) continue; + Bitmap b = bd.getBitmap(); + Bitmap bResized = Bitmap.createScaledBitmap(b, b.getWidth()/2, b.getHeight()/2, false); + bd = new BitmapDrawable(res, bResized); + bd.setGravity(Gravity.CENTER_HORIZONTAL); + iconLayer[1] = bd; + LayerDrawable icon = new LayerDrawable(iconLayer); + positionMarker.setIcon(icon); + result.add(positionMarker); + poiMarkers[getPos(type)].add(positionMarker); } break; } @@ -1055,12 +1063,9 @@ if(timeStr != null && !timeStr.equals("")) time = Long.parseLong(pathMarkers.get(i).getUid()) / 1000; current = new DbGeoPoint(gp.getLatitude(), gp.getLongitude(), gp.getAltitude(), time); if(pathMarkers.get(i).getTitle() == null){ - Log.d(TAG, "Waypoint #" + i + " is new!"); long rowId = addPoi(current); currentNew = true; current.setId(rowId); - } else { - Log.e(TAG, "Waypoint #" + i + " exists with title " + pathMarkers.get(i).getTitle()); } if(current != null && last != null){ long rowId = addPoi(new Path(0, 0, exposed, diffWet, giddiness, climbing, last, current));