Search in sources :

Example 21 with BitmapDescriptor

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;
}
Also used : Bitmap(android.graphics.Bitmap) BitmapDescriptor(com.google.android.gms.maps.model.BitmapDescriptor)

Example 22 with 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());
}
Also used : BitmapDescriptor(com.google.android.gms.maps.model.BitmapDescriptor) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 23 with BitmapDescriptor

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);
}
Also used : BitmapDescriptor(com.google.android.gms.maps.model.BitmapDescriptor) Point(com.google.maps.android.geometry.Point) SuppressLint(android.annotation.SuppressLint)

Example 24 with BitmapDescriptor

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());
}
Also used : BitmapDescriptor(com.google.android.gms.maps.model.BitmapDescriptor)

Example 25 with BitmapDescriptor

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;
}
Also used : GeoJsonPointStyle(com.google.maps.android.geojson.GeoJsonPointStyle) BitmapDescriptor(com.google.android.gms.maps.model.BitmapDescriptor)

Aggregations

BitmapDescriptor (com.google.android.gms.maps.model.BitmapDescriptor)29 LatLng (com.google.android.gms.maps.model.LatLng)10 Bitmap (android.graphics.Bitmap)9 MarkerOptions (com.google.android.gms.maps.model.MarkerOptions)9 Marker (com.google.android.gms.maps.model.Marker)7 SuppressLint (android.annotation.SuppressLint)4 GroundOverlayOptions (com.google.android.gms.maps.model.GroundOverlayOptions)4 Point (com.google.maps.android.geometry.Point)4 RemoteImageLoader (com.omkarmoghe.pokemap.helpers.RemoteImageLoader)4 GeoJsonPointStyle (com.google.maps.android.geojson.GeoJsonPointStyle)3 FortDataOuterClass (POGOProtos.Map.Fort.FortDataOuterClass)2 GoogleMap (com.google.android.gms.maps.GoogleMap)2 GroundOverlay (com.google.android.gms.maps.model.GroundOverlay)2 IALatLng (com.indooratlas.android.sdk.resources.IALatLng)2 GymMarkerExtended (com.omkarmoghe.pokemap.models.map.GymMarkerExtended)2 PokemonMarkerExtended (com.omkarmoghe.pokemap.models.map.PokemonMarkerExtended)2 PokestopMarkerExtended (com.omkarmoghe.pokemap.models.map.PokestopMarkerExtended)2 Pokestop (com.pokegoapi.api.map.fort.Pokestop)2 CatchablePokemon (com.pokegoapi.api.map.pokemon.CatchablePokemon)2 PokemonIdOuterClass (POGOProtos.Enums.PokemonIdOuterClass)1