private void fetchBrandedJSONAndInit(String url) { new RetrieveJSONTask() { @Override protected void onPostExecute(JSONObject jsonObject) { initWithTileJSON(jsonObject); } } .execute(url); }
public BingTileLayer(String key) { super("Bing Tile Layer", BASE_URL_PATTERN, false); setBingMapKey(key); // Default Bing Maps zoom levels. this.setMinimumZoomLevel(1); this.setMaximumZoomLevel(22); getMetadata(); }
/** * Reads and opens a MBTiles file given by url and loads its tiles into this layer. */ private void initialize(String url, final Context context) { initialize(getFile(url, context)); }
/** * 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(); } }
/** * Initialize a new tile layer, represented by a Database file. * * @param db a database used as the MBTiles source */ public MBTilesLayer(final SQLiteDatabase db) { super(getFileName(db.getPath()), db.getPath()); initialize(db); }
@Override public TileLayer setURL(final String aUrl) { super.setURL(aUrl + "/%d/%d/%d.png?updated=%d"); return this; }
/** * 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); }
/** * Gets the minimum zoom level this tile provider can provide * * @return the minimum zoom level */ public float getMinimumZoomLevel() { return mTileSource.getMinimumZoomLevel(); }
/** * Get the tile provider suggested starting zoom. * * @return the tile suggested starting zoom */ public float getCenterZoom() { return mTileSource.getCenterZoom(); }
/** * Get the maximum zoom level this tile provider can provide. * * @return the maximum zoom level */ public float getMaximumZoomLevel() { return mTileSource.getMaximumZoomLevel(); }
/** * Get the tile size in pixels this tile provider provides. * * @return the tile size in pixels */ public int getTileSizePixels() { return mTileSource.getTileSizePixels(); }
/** * Get the tile provider bounding box. * * @return the tile source bounding box */ public BoundingBox getBoundingBox() { return mTileSource.getBoundingBox(); }
/** * Get the tile provider center. * * @return the tile source center */ public LatLng getCenterCoordinate() { return mTileSource.getCenterCoordinate(); }
@Override public String getCacheKey() { return "Bing " + getStyle(); }
@Override protected void initialize(String pId, String aUrl, boolean enableSSL) { mId = pId; super.initialize(pId, aUrl, enableSSL); }
public WebSourceTileLayer(final String pId, final String url, final boolean enableSSL) { super(pId, url); initialize(pId, url, enableSSL); }
@Override public int getTileSizePixels() { TileLayer tileLayer = mTileSource.get(); return (tileLayer != null) ? tileLayer.getTileSizePixels() : 0; }
@Override public TileLayer setURL(final String aUrl) { if (aUrl.contains(String.format(MAPBOX_LOCALE, "http%s://", (mEnableSSL ? "" : "s")))) { super.setURL(aUrl.replace(String.format(MAPBOX_LOCALE, "http%s://", (mEnableSSL ? "" : "s")), String.format(MAPBOX_LOCALE, "http%s://", (mEnableSSL ? "s" : "")))); } else { super.setURL(aUrl); } return this; }
/** * Initialize a new tile layer, represented by a MBTiles file. * * @param url path to a MBTiles file * @param context the graphics drawing context */ public MBTilesLayer(final Context context, final String url) { super(url.substring(url.lastIndexOf('/') + 1, url.lastIndexOf('.')), url); initialize(url, context); }
protected void initialize(String pId, String aUrl, boolean enableSSL) { mEnableSSL = enableSSL; setURL(aUrl); }