android - how to attach a TextView on a google map Marker -
android - how to attach a TextView on a google map Marker -
i might have asked similar question didn't reply because wasn't precise wanted do. i'm using android-maps-utils (https://github.com/googlemaps/android-maps-utils) chris broadfoot display short info messages in bubbleicons on google map in android app.
the thing want attach textview relative position of marker on map display other infos going dynamic (as opposed bitmap pics generated great library); sort of countdown in case.
would have thought of how programmatically.
thanks in advance, have nice day !
the library have class handle markers icons, called bubbleiconfactory. default alter text within marker can alter whatever want setting content view this:
bubbleiconfactory mbubblefactory = new bubbleiconfactory(this); mbubblefactory.setcontentview(mimageview); mimageview.setimagebitmap(.....); bitmap iconbitmap = mbubblefactory.makeicon(); mmap.addmarker(new markeroptions().icon(bitmapdescriptorfactory.frombitmap(iconbitmap)).position(myposition).title("my current position"));
that's hoy image within marker should same want because set view parameter in setcontentview method. notice markers , infowindows in maps not live views render images there no way "refresh" content without render again. this video help , i'm not sure guess bubbleiconfactory deprecated , should utilize icongenerator instead, in library code. hope helps.
edit:
also take @ how plains google maps works have improve thought of library using:
https://developers.google.com/maps/documentation/android/marker?hl=es
https://developers.google.com/maps/documentation/android/infowindows?hl=es#custom_info_windows
android google-maps google-maps-markers google-maps-api-2
Comments
Post a Comment