use of com.google.android.gms.maps.model.BitmapDescriptor in project android-maps-utils by googlemaps.
the class DefaultClusterRenderer method onBeforeClusterRendered.
/**
* Called before the marker for a Cluster is added to the map.
* The default implementation draws a circle with a rough count of the number of items.
*/
protected void onBeforeClusterRendered(Cluster<T> cluster, MarkerOptions markerOptions) {
int bucket = getBucket(cluster);
BitmapDescriptor descriptor = mIcons.get(bucket);
if (descriptor == null) {
mColoredCircleBackground.getPaint().setColor(getColor(bucket));
descriptor = BitmapDescriptorFactory.fromBitmap(mIconGenerator.makeIcon(getClusterText(bucket)));
mIcons.put(bucket, descriptor);
}
// TODO: consider adding anchor(.5, .5) (Individual markers will overlap more often)
markerOptions.icon(descriptor);
}
use of com.google.android.gms.maps.model.BitmapDescriptor in project android-maps-utils by googlemaps.
the class KmlRenderer method scaleBitmap.
/**
* Enlarges or shrinks a bitmap image based on the scale provided
* @param style Style to retrieve iconUrl and scale from
* @param placemarks
* @param placemark Placemark object to set the image to
*/
private void scaleBitmap(KmlStyle style, HashMap<KmlPlacemark, Object> placemarks, KmlPlacemark placemark) {
double bitmapScale = style.getIconScale();
String bitmapUrl = style.getIconUrl();
Bitmap bitmapImage = getImagesCache().get(bitmapUrl);
BitmapDescriptor scaledBitmap = scaleIcon(bitmapImage, bitmapScale);
((Marker) placemarks.get(placemark)).setIcon(scaledBitmap);
}
use of com.google.android.gms.maps.model.BitmapDescriptor in project coins-android by bubelov.
the class StaticClusterRenderer method onBeforeClusterRendered.
/**
* Called before the marker for a Cluster is added to the map.
* The default implementation draws a circle with a rough count of the number of items.
*/
protected void onBeforeClusterRendered(Cluster<T> cluster, MarkerOptions markerOptions) {
int bucket = getBucket(cluster);
BitmapDescriptor descriptor = mIcons.get(bucket);
if (descriptor == null) {
mColoredCircleBackground.getPaint().setColor(getColor(bucket));
descriptor = BitmapDescriptorFactory.fromBitmap(mIconGenerator.makeIcon(getClusterText(bucket)));
mIcons.put(bucket, descriptor);
}
// TODO: consider adding anchor(.5, .5) (Individual markers will overlap more often)
markerOptions.icon(descriptor);
}
use of com.google.android.gms.maps.model.BitmapDescriptor in project wigle-wifi-wardriving by wiglenet.
the class KmlRenderer method scaleBitmap.
/**
* Enlarges or shrinks a bitmap image based on the scale provided
* @param style Style to retrieve iconUrl and scale from
* @param placemark Placemark object to set the image to
*/
private void scaleBitmap(KmlStyle style, HashMap<KmlPlacemark, Object> placemarks, KmlPlacemark placemark) {
double bitmapScale = style.getIconScale();
String bitmapUrl = style.getIconUrl();
Bitmap bitmapImage = mImagesCache.get(bitmapUrl);
BitmapDescriptor scaledBitmap = scaleIcon(bitmapImage, bitmapScale);
((Marker) placemarks.get(placemark)).setIcon(scaledBitmap);
}
use of com.google.android.gms.maps.model.BitmapDescriptor in project wigle-wifi-wardriving by wiglenet.
the class KmlRenderer method addGroundOverlayToMap.
/**
* Adds ground overlays from a given URL onto the map
*
* @param groundOverlayUrl url of ground overlay
* @param groundOverlays hashmap of ground overlays to add to the map
*/
private void addGroundOverlayToMap(String groundOverlayUrl, HashMap<KmlGroundOverlay, GroundOverlay> groundOverlays, boolean containerVisibility) {
BitmapDescriptor groundOverlayBitmap = BitmapDescriptorFactory.fromBitmap(mImagesCache.get(groundOverlayUrl));
for (KmlGroundOverlay kmlGroundOverlay : groundOverlays.keySet()) {
if (kmlGroundOverlay.getImageUrl().equals(groundOverlayUrl)) {
GroundOverlayOptions groundOverlayOptions = kmlGroundOverlay.getGroundOverlayOptions().image(groundOverlayBitmap);
GroundOverlay mapGroundOverlay = mMap.addGroundOverlay(groundOverlayOptions);
if (containerVisibility == false) {
mapGroundOverlay.setVisible(false);
}
groundOverlays.put(kmlGroundOverlay, mapGroundOverlay);
}
}
}
Aggregations