Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTPTileDataSource wikimapia #535

Open
StalkerExplorer opened this issue Apr 5, 2023 · 1 comment
Open

HTTPTileDataSource wikimapia #535

StalkerExplorer opened this issue Apr 5, 2023 · 1 comment

Comments

@StalkerExplorer
Copy link

Hello,
how to use wikimapia with HTTPTileDataSource?
Is that possible?

But it doesn't work:
int minZoom=0;
int maxZoom=20;
String mapUrl="http://i{s}.wikimapia.org/?x={x}&y={y}&zoom={z}&r=0&type=map&lng=0";
String servers="(x%4)+(y%4)*4";
StringVector mStringVector=new StringVector();
mStringVector.add(servers);
HTTPTileDataSource mHTTPTileDataSource=new HTTPTileDataSource(minZoom, maxZoom, mapUrl);

Could you help me with that sample code, thank you so much.

@mtehver
Copy link
Contributor

mtehver commented Apr 5, 2023

Hello. If I understand correctly, the server hostname part depends on tile coordinates? In that case you need to create a custom subclass of HTTPTileDataSource and you need to override its buildTileURL method, which takes 2 arguments: baseURL (which you can basically ignore) and mapTile, which you need to use to form correct map URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants