I'm using olwidget with a local tile provider (specifically http://mapspot.ge ), and in order to make it work, I had to add the following to olwidget.js in the "osm" dictionary:
omc: function() {
return new OpenLayers.Layer.OSM("Open Maps Caucasus",
[
"http://a.tile.mapspot.ge/en/${z}/${x}/${y}.png"
],
{ numZoomLevels: 19,
attribution: "<a href=\"http://mapspot.ge\" target=\"_blank\">MapSpot</a> - Data by JumpStart International"});
}
},
and then create a map of the type osm["omc"] in Django; there is no way, as far as I can tell, to do this purely from Django (aside from writing your own javascript template that generates the appropriate OpenLayers constructor, but then you're not really using olwidget anymore). I know that custom tile servers are relatively rare, but they do exist (I also found http://tile.openstreetmap.nl ), and so it would be very nice if there were an option to use a custom tile server (and attribution, of course) that follows the OpenStreetMap XYZ URL format.
I'm using olwidget with a local tile provider (specifically http://mapspot.ge ), and in order to make it work, I had to add the following to olwidget.js in the "osm" dictionary:
and then create a map of the type osm["omc"] in Django; there is no way, as far as I can tell, to do this purely from Django (aside from writing your own javascript template that generates the appropriate OpenLayers constructor, but then you're not really using olwidget anymore). I know that custom tile servers are relatively rare, but they do exist (I also found http://tile.openstreetmap.nl ), and so it would be very nice if there were an option to use a custom tile server (and attribution, of course) that follows the OpenStreetMap XYZ URL format.