I am going to try and explain what i am trying to achieve with my markers added to the map. Okay so the user taps on the marker and the camera intent starts then the user can take a photo. Once the marker has been added the user can then tap on the marker and in the CustomInfoWindow the thumbnail of that image is displayed. This all works, but when exiting the app and returning the marker is there but the image not.
So this is what happens in my drawMarker method:
private void drawMarker(LatLng point, String title, String snippet, String id, String filep) {
Marker marker = googleMap.addMarker(new MarkerOptions()
.title(title)
.snippet(snippet)
.position(thePoint));
markerId = marker.getId();
So the marker is drawing with the title and the snippet. So i know i have to somehow tell the drawMarker method of the filep (this is the image file path saved in the SQLite Database). I have tried using `.icon(....) but it then just replaces the default marker with the thumbnail of the image taken which then in turn makes loading the map extremely slow once the user has added several markers.
Here is my code for the customInfoWindow method:
@Override
public View getInfoContents(Marker marker)
{
View v = getLayoutInflater().inflate(R.layout.infowindow_layout, null);
ImageView markerIcon = (ImageView) v.findViewById(R.id.marker_icon);
Bitmap bitmap = myMarkersHash.get(marker.getId());
markerIcon.setImageBitmap(bitmap);
(this code is for when the user returns from the camera intent) now i need to add to this when the map reloads to load the image file taken for that image.
Any suggestions or help will be appreciated.
Aucun commentaire:
Enregistrer un commentaire