private void initWithTileJSON(JSONObject aTileJSON) { this.setTileJSON((aTileJSON != null) ? aTileJSON : new JSONObject()); if (aTileJSON != null) { if (this.tileJSON.has("tiles")) { try { setURL(this.tileJSON.getJSONArray("tiles").getString(0).replace(".png", "{2x}.png")); } catch (JSONException e) { Log.e(TAG, "Couldn't set tile url", e); } } mMinimumZoomLevel = getJSONFloat(this.tileJSON, "minzoom"); mMaximumZoomLevel = getJSONFloat(this.tileJSON, "maxzoom"); mName = this.tileJSON.optString("name"); mDescription = this.tileJSON.optString("description"); mAttribution = this.tileJSON.optString("attribution"); mLegend = this.tileJSON.optString("legend"); double[] center = getJSONDoubleArray(this.tileJSON, "center", 3); if (center != null) { mCenter = new LatLng(center[0], center[1], center[2]); } double[] bounds = getJSONDoubleArray(this.tileJSON, "bounds", 4); if (bounds != null) { mBoundingBox = new BoundingBox(bounds[3], bounds[2], bounds[1], bounds[0]); } } if (UtilConstants.DEBUGMODE) { Log.d(TAG, "TileJSON " + this.tileJSON.toString()); } }