/** * Adds all given ground overlays to the map * * @param groundOverlays hashmap of ground overlays to add to the map */ private void addGroundOverlays(HashMap<KmlGroundOverlay, GroundOverlay> groundOverlays) { for (KmlGroundOverlay groundOverlay : groundOverlays.keySet()) { String groundOverlayUrl = groundOverlay.getImageUrl(); if (groundOverlayUrl != null && groundOverlay.getLatLngBox() != null) { // Can't draw overlay if url and coordinates are missing if (getImagesCache().get(groundOverlayUrl) != null) { addGroundOverlayToMap(groundOverlayUrl, mGroundOverlays, true); } else if (!mGroundOverlayUrls.contains(groundOverlayUrl)) { mGroundOverlayUrls.add(groundOverlayUrl); } } } }
public void testGroundOverlay() throws Exception { XmlPullParser xmlPullParser = createParser(R.raw.amu_ground_overlay); KmlGroundOverlay groundOverlay = KmlFeatureParser.createGroundOverlay(xmlPullParser); assertNotNull(groundOverlay); assertEquals(groundOverlay.getProperty("name"), "Sample Ground Overlay"); assertNotNull(groundOverlay.getImageUrl()); assertEquals(groundOverlay.getGroundOverlayOptions().getZIndex(), 99.0f); assertTrue(groundOverlay.getGroundOverlayOptions().isVisible()); assertNotNull(groundOverlay.getLatLngBox()); xmlPullParser = createParser(R.raw.amu_ground_overlay_color); groundOverlay = KmlFeatureParser.createGroundOverlay(xmlPullParser); assertNotNull(groundOverlay); }