Search in sources :

Example 1 with GroundOverlay

use of com.google.android.gms.maps.model.GroundOverlay in project android-maps-utils by googlemaps.

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(getImagesCache().get(groundOverlayUrl));
    for (KmlGroundOverlay kmlGroundOverlay : groundOverlays.keySet()) {
        if (kmlGroundOverlay.getImageUrl().equals(groundOverlayUrl)) {
            GroundOverlayOptions groundOverlayOptions = kmlGroundOverlay.getGroundOverlayOptions().image(groundOverlayBitmap);
            GroundOverlay mapGroundOverlay = attachGroundOverlay(groundOverlayOptions);
            if (!containerVisibility) {
                mapGroundOverlay.setVisible(false);
            }
            groundOverlays.put(kmlGroundOverlay, mapGroundOverlay);
        }
    }
}
Also used : GroundOverlayOptions(com.google.android.gms.maps.model.GroundOverlayOptions) BitmapDescriptor(com.google.android.gms.maps.model.BitmapDescriptor) GroundOverlay(com.google.android.gms.maps.model.GroundOverlay)

Aggregations

BitmapDescriptor (com.google.android.gms.maps.model.BitmapDescriptor)1 GroundOverlay (com.google.android.gms.maps.model.GroundOverlay)1 GroundOverlayOptions (com.google.android.gms.maps.model.GroundOverlayOptions)1