@Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { if (mGroundOverlay != null) { mGroundOverlay.setTransparency((float) progress / (float) TRANSPARENCY_MAX); } }
/** * Removes all ground overlays in the given hashmap * * @param groundOverlays hashmap of ground overlays to remove */ private void removeGroundOverlays(HashMap<KmlGroundOverlay, GroundOverlay> groundOverlays) { for (GroundOverlay groundOverlay : groundOverlays.values()) { groundOverlay.remove(); } }
@Override public void onAnimationUpdate(ValueAnimator valueAnimator) { final Integer val = (Integer) valueAnimator.getAnimatedValue(); groundOverlay.setDimensions(val); } });
/** * Toggles the visibility between 100% and 50% when a {@link GroundOverlay} is clicked. */ @Override public void onGroundOverlayClick(GroundOverlay groundOverlay) { // Toggle transparency value between 0.0f and 0.5f. Initial default value is 0.0f. mGroundOverlayRotated.setTransparency(0.5f - mGroundOverlayRotated.getTransparency()); }
@Override public void onEnterRegion(IARegion region) { if (region.getType() == IARegion.TYPE_FLOOR_PLAN) { final String newId = region.getId(); // Are we entering a new floor plan or coming back the floor plan we just left? if (mGroundOverlay == null || !region.equals(mOverlayFloorPlan)) { mCameraPositionNeedsUpdating = true; // entering new fp, need to move camera if (mGroundOverlay != null) { mGroundOverlay.remove(); mGroundOverlay = null; } mOverlayFloorPlan = region; // overlay will be this (unless error in loading) fetchFloorPlanBitmap(region.getFloorPlan()); } else { mGroundOverlay.setTransparency(0.0f); } mShowIndoorLocation = true; showInfo("Showing IndoorAtlas SDK\'s location output"); } showInfo("Enter " + (region.getType() == IARegion.TYPE_VENUE ? "VENUE " : "FLOOR_PLAN ") + region.getId()); }
/** * 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); } } }
/** * Toggles the clickability of the smaller, rotated overlay based on the state of the View that * triggered this call. * This callback is defined on the CheckBox in the layout for this Activity. */ public void toggleClickability(View view) { if (mGroundOverlayRotated != null) { mGroundOverlayRotated.setClickable(((CheckBox) view).isChecked()); } } }
@Override public void onGroundOverlayClick(GroundOverlay groundOverlay) { onClick((CustomTag) groundOverlay.getTag()); }
public void switchImage(View view) { mCurrentEntry = (mCurrentEntry + 1) % mImages.size(); mGroundOverlay.setImage(mImages.get(mCurrentEntry)); }
@Override public void setTag(Object tag) { real.setTag(tag); }
@Override public float getTransparency() { return real.getTransparency(); }
@Override public void setVisible(boolean visible) { real.setVisible(visible); }
@Override public void setClickable(boolean clickable) { real.setClickable(clickable); }
@Override public Object getTag() { return real.getTag(); }
@Override public void setImage(BitmapDescriptor image) { real.setImage(image); }
.position(SYDNEY, 700000) .clickable(true)); mSydneyGroundOverlay.setTag(new CustomTag("Sydney ground overlay"));
@Override public void onAnimationUpdate(ValueAnimator valueAnimator) { Float val = (Float) valueAnimator.getAnimatedValue(); groundOverlay.setTransparency(val); } });
/** * Removes all ground overlays in the given hashmap * * @param groundOverlays hashmap of ground overlays to remove */ private void removeGroundOverlays(HashMap<KmlGroundOverlay, GroundOverlay> groundOverlays) { for (GroundOverlay groundOverlay : groundOverlays.values()) { groundOverlay.remove(); } }
@Override public void setDimensions(float width, float height) { real.setDimensions(width, height); }
/** * 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); } } }