remove restrictions on zoom in getPosition. instead, after a defaault base layer is set, use setZoom(getZoom) to ensure zoom level is valid for this base map

This commit is contained in:
Jon Atkins
2013-05-19 16:07:10 +01:00
parent 653a6cc82d
commit 7b574b9ea1
2 changed files with 11 additions and 4 deletions

View File

@ -253,6 +253,12 @@ window.setMapBaseLayer = function() {
var baseLayer = nameToLayer[localStorage['iitc-base-map']] || firstLayer;
map.addLayer(baseLayer);
//after choosing a base layer, ensure the zoom is valid for this layer
//(needs to be done here - as we don't know the base layer zoom limit before this)
map.setZoom(map.getZoom());
//event to track layer changes and store the name
map.on('baselayerchange', function() {
for(i in window.layerChooser._layers) {
var obj = window.layerChooser._layers[i];
@ -264,6 +270,7 @@ window.setMapBaseLayer = function() {
});
}
// renders player details into the website. Since the player info is