osm-in / osm-in.github.io

OpenStreetMap India hompeage
http://openstreetmap.in/
MIT License
27 stars 23 forks source link

OSM India raster tiles URL doesn't work anymore #40

Closed Aravindz closed 3 years ago

Aravindz commented 3 years ago

GET request to the URL fails.

planemad commented 3 years ago

@Aravindz which url are you referring to? https://openstreetmap.in/ works fine.

Aravindz commented 3 years ago

This url

https://{a,b,c}.tiles.mapbox.com/v4/openstreetmap.1b68f018/z/x/y.png?access_token=pk.eyJ1Ijoib3NtLWluIiwiYSI6ImNqcnVxMTNrNTJwbHc0M250anUyOW81MjgifQ.cZnvZEyWT5AzNeO3ajg5tg

This url was working until yesterday. But now this is not working. Can you please resolve it asap??

planemad commented 3 years ago

Unfortunately those tiles are no longer available due to a deprecation of a legacy Mapbox API which was used.

As a quick fix see if this works if you are using leaflet:

var map = L.map('map');

L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
attribution: '© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/" target="_blank">Improve this map</a></strong>',
tileSize: 512,
maxZoom: 18,
zoomOffset: -1,
id: 'planemad/ckf4xcet7231819mm2e8njlca',
accessToken: 'pk.YOUR_MAPBOX_ACCESS_TOKEN'
}).addTo(map);

Get a free token from mapbox.com which should be sufficient for upto 50,000 tiles/month. Will try to document this in the repo so others can use it.