Skip to content

Commit

Permalink
Fixed issue #10589: OSM - Aerial View Limited To Specific Zoom Level 10
Browse files Browse the repository at this point in the history
Dev: Zoom to 11 when switching to Aerial or Hybrid views
  • Loading branch information
tpartner committed May 2, 2016
1 parent c4fe8d6 commit b5ad3fa
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions scripts/map.js
Expand Up @@ -127,6 +127,26 @@ function OSGeoInitialize(question,latLng){
UI_update(e.latlng.lat,e.latlng.lng)
}
)

// Zoom to 11 when switching to Aerial or Hybrid views - bug 10589
var layer2Name, layer3Name, layerIndex = 0;
for (var key in baseLayers) {
if (!baseLayers.hasOwnProperty(key)) {
continue;
}
if(layerIndex == 1) {
layer2Name = key;
}
else if(layerIndex == 2) {
layer3Name = key;
}
layerIndex++;
}
map.on('baselayerchange', function(e) {
if(e.name == layer2Name || e.name == layer3Name) {
map.setZoom(11);
}
});

marker.on('dragend', function(e){
var marker = e.target;
Expand Down

0 comments on commit b5ad3fa

Please sign in to comment.