Code example for Marker

Methods: setIcon

0
 
        @Override 
        public boolean onMarkerClick(Marker marker) {
            float newHue = MARKER_HUES[new Random().nextInt(MARKER_HUES.length)];
            mMarkerInfo.mHue = newHue;
            marker.setIcon(BitmapDescriptorFactory.defaultMarker(newHue));
            return true; 
        } 
 
        private void setUpMapIfNeeded() { 
            // Do a null check to confirm that we have not already instantiated the map. 
            if (mMap == null) {
                // Try to obtain the map from the SupportMapFragment. 
                mMap = getMap();
                // Check if we were successful in obtaining the map. 
                if (mMap != null) {
                    setUpMap(); 
                } 
            } 
        }