Back to project page android-gmaps-addons.
The source code is released under:
Copyright (c) 2014 Jonathan Baker Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Sof...
If you think the Android project android-gmaps-addons listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.cocoahero.android.gmaps.addons.osm; //from w w w . j a v a 2 s .c om import java.net.MalformedURLException; import java.net.URL; import com.google.android.gms.maps.model.UrlTileProvider; public class OpenStreetMapTileProvider extends UrlTileProvider { // ------------------------------------------------------------------------ // Private Constants // ------------------------------------------------------------------------ private static final String FORMAT = "http://tile.openstreetmap.org/%d/%d/%d.png"; // ------------------------------------------------------------------------ // Constructors // ------------------------------------------------------------------------ public OpenStreetMapTileProvider() { super(256, 256); } // ------------------------------------------------------------------------ // Public Methods // ------------------------------------------------------------------------ @Override public URL getTileUrl(int x, int y, int z) { try { return new URL(String.format(FORMAT, z, x, y)); } catch (MalformedURLException e) { return null; } } }