/** * Sets the tile source for this tile provider. * * @param pTileSource the tile source */ public void setTileSource(final ITileLayer pTileSource) { if (mTileSource != null) { mTileSource.detach(); } mTileSource = pTileSource; if (mTileSource != null) { mCacheKey = mTileSource.getCacheKey(); } }
public void addTileSource(final ITileLayer pTileSource, final int index) { if (pTileSource == null) { return; } final MapTileDownloader downloaderProvider = new MapTileDownloader(pTileSource, mTileCache, mNetworkAvailabilityCheck, mMapView); if (hasNoSource()) { mCacheKey = pTileSource.getCacheKey(); } synchronized (mTileProviderList) { if (index < 0 || index > mTileProviderList.size()) { return; } mTileProviderList.add(index, downloaderProvider); } }