Feels like you need to rip out the code generateMarker() functionality and expose a separate method to update the icon bitmap.  That would avoid having to expose the internals of how the bitmap generation is done in the click handlers.