I'm trying to create a jquery mobile phonegap app and I want to use leaflet maps embedded in it. I'm doing a pretty basic proof-of-concept at the moment, but I'm not having much luck. Every time I try to load the map, the .png of the map doesn't load and the console tells me its Forbidden. I think I'm probably setting up the map URL wrong, but the documentation is a little fuzzy on the CloudMade website. Any help you can provide would be greatly appreciated.
Code:
var map = new L.Map('map');
var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/MY_APP_KEY/997/256/{z}/{x}/{y}.png',
cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18});
map.addLayer(cloudmade);
map.locateAndSetView(16);
map.on('locationfound', onLocationFound);
function onLocationFound(e) {
var radius = e.accuracy / 2;
var marker = new L.Marker(e.latlng);
map.addLayer(marker);
marker.bindPopup("You are within " + radius + " meters from this point").openPopup();
var circle = new L.Circle(e.latlng, radius);
map.addLayer(circle);
}
map.on('locationerror', onLocationError);
function onLocationError(e) {
alert(e.message);
}
When I try to load the image, I get the following error: GET http://a.tile.cloudmade.com/MY_APP_KEY/997/256/0/0/0.png 403 (Forbidden). Obviously I'm replacing MY_APP_KEY with my key that I got from CloudMade, but other than that, I'm not sure where else to turn.
Thanks in advance for the help.