public WebSourceTileLayer(final String pId, final String url, final boolean enableSSL) { super(pId, url); initialize(pId, url, enableSSL); }
/** * Get a single Tile URL for a single tile. * * @param aTile a map tile * @param hdpi a boolean that indicates whether the tile should be at 2x or retina size * @return a list of tile URLs */ public String getTileURL(final MapTile aTile, boolean hdpi) { return parseUrlForTile(mUrl, aTile, hdpi); }
@Override public TileLayer setURL(final String aUrl) { super.setURL(aUrl + "/%d/%d/%d.png?updated=%d"); return this; }
String[] urls = getTileURLs(aTile, tempHDPI); CacheableBitmapDrawable result = null; Bitmap resultBitmap = null; Bitmap bitmap = getBitmapFromURL(aTile, url, cache); if (bitmap == null) { continue; resultBitmap = bitmap; } else { resultBitmap = compositeBitmaps(bitmap, resultBitmap); if (checkThreadControl()) { if (listener != null) { listener.onTilesLoaded();
private void selectOnlineBasemap() { //create OSM tile layer String defaultTilePID = mapActivity.getString(R.string.defaultTileLayerPID); String defaultTileURL = mapActivity.getString(R.string.defaultTileLayerURL); String defaultTileName = mapActivity.getString(R.string.defaultTileLayerName); String defaultTileAttribution = mapActivity.getString(R.string.defaultTileLayerAttribution); WebSourceTileLayer ws = new WebSourceTileLayer(defaultTilePID, defaultTileURL); ws.setName(defaultTileName).setAttribution(defaultTileAttribution); setSelectedBasemap(ONLINE); //add OSM tile layer to map mapView.setTileSource(ws); }
/** * Gets a list of Tile URLs used by this layer for a specific tile. * * @param aTile a map tile * @param hdpi a boolean that indicates whether the tile should be at 2x or retina size * @return a list of tile URLS */ public String[] getTileURLs(final MapTile aTile, boolean hdpi) { String url = getTileURL(aTile, hdpi); if (!TextUtils.isEmpty(url)) { return new String[] { url }; } return null; }
protected void initialize(String pId, String aUrl, boolean enableSSL) { mEnableSSL = enableSSL; setURL(aUrl); }