private Overlay createPolygon ( BoundingBox key , Integer value , int redthreshold , int orangethreshold ) { Polygon polygon = new Polygon ( mMapView ) ; if ( value < orangethreshold ) polygon . setFillColor ( Color . parseColor ( alpha + yellow ) ) ; else if ( value < redthreshold ) polygon . setFillColor ( Color . parseColor ( alpha + orange ) ) ; else if ( value >= redthreshold ) polygon . setFillColor ( Color . parseColor ( alpha + red ) ) ; else { //no polygon } polygon . setStrokeColor ( polygon . getFillColor ( ) ) ; //if you set this to something like 20f and have a low alpha setting, // you'll end with a gaussian blur like effect polygon . setStrokeWidth ( 0f ) ; List < GeoPoint > pts = new ArrayList < GeoPoint > ( ) ; pts . add ( new GeoPoint ( key . getLatNorth ( ) , key . getLonWest ( ) ) ) ; pts . add ( new GeoPoint ( key . getLatNorth ( ) , key . getLonEast ( ) ) ) ; pts . add ( new GeoPoint ( key . getLatSouth ( ) , key . getLonEast ( ) ) ) ; pts . add ( new GeoPoint ( key . getLatSouth ( ) , key . getLonWest ( ) ) ) ; polygon . setPoints ( pts ) ; return polygon ; }
converts the bounding box into a color filled polygon