use of com.google.android.gms.maps.model.BitmapDescriptor in project android-maps-utils by googlemaps.
the class Renderer method getCachedGroundOverlayImage.
/**
* Gets a cached image needed for GroundOverlays images
*
* @param url URL to get cached image for
* @return BitmapDescriptor
*/
protected BitmapDescriptor getCachedGroundOverlayImage(String url) {
BitmapDescriptor bitmapDescriptor = mImagesCache.groundOverlayImagesCache.get(url);
if (bitmapDescriptor == null) {
Bitmap bitmap = mImagesCache.bitmapCache.get(url);
if (bitmap != null) {
bitmapDescriptor = BitmapDescriptorFactory.fromBitmap(bitmap);
mImagesCache.groundOverlayImagesCache.put(url, bitmapDescriptor);
}
}
return bitmapDescriptor;
}
use of com.google.android.gms.maps.model.BitmapDescriptor in project android-maps-utils by googlemaps.
the class GeoJsonPointStyleTest method testIcon.
// FIXME
@Ignore("I should run via Robolectric - java.lang.NullPointerException: IBitmapDescriptorFactory is not initialized")
@Test
public void testIcon() {
if (TestUtil.isRunningOnTravis()) {
Assume.assumeTrue("Skipping GeoJsonPointStyleTest.testIcon() - this is expected behavior on Travis CI (#573)", false);
return;
}
BitmapDescriptor icon = BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN);
pointStyle.setIcon(icon);
assertEquals(icon, pointStyle.getIcon());
assertEquals(icon, pointStyle.toMarkerOptions().getIcon());
}
use of com.google.android.gms.maps.model.BitmapDescriptor in project wigle-wifi-wardriving by wiglenet.
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 wigle-wifi-wardriving by wiglenet.
the class GeoJsonPointStyleTest method testIcon.
public void testIcon() throws Exception {
BitmapDescriptor icon = BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN);
pointStyle.setIcon(icon);
assertEquals(icon, pointStyle.getIcon());
assertEquals(icon, pointStyle.toMarkerOptions().getIcon());
}
use of com.google.android.gms.maps.model.BitmapDescriptor in project iosched by google.
the class MapUtils method createLabelMarker.
/**
* Creates a GeoJsonPointStyle for a label.
*
* @param iconFactory Reusable IconFactory
* @param title Id to be embedded as the title
* @param label Text to be shown on the label
*/
private static GeoJsonPointStyle createLabelMarker(IconGenerator iconFactory, String title, String label) {
final BitmapDescriptor icon = BitmapDescriptorFactory.fromBitmap(iconFactory.makeIcon(label));
GeoJsonPointStyle pointStyle = new GeoJsonPointStyle();
pointStyle.setAnchor(0.5f, 0.5f);
pointStyle.setTitle(title);
pointStyle.setIcon(icon);
pointStyle.setVisible(false);
return pointStyle;
}
Aggregations