1 : {[parseInt(values.scale)]}
',
editable: false,
triggerAction: 'all', // needed so that the combo box doesn't filter by its current content
mode: 'local' // keep the combo box from forcing a lot of unneeded data refreshes
});
zoomSelector.on('select',
function(combo, record, index) {
map.zoomTo(record.data.level);
},
this
);
map.events.register('zoomend', this, function() {
var scale = scaleStore.queryBy(function(record){
return this.map.getZoom() == record.data.level;
});
if (scale.length > 0) {
scale = scale.items[0];
zoomSelector.setValue("1 : " + parseInt(scale.data.scale,10));
} else {
if (!zoomSelector.rendered) {return;}
zoomSelector.clearValue();
}
});
var ctrl, toolbarItems = [], action, actions = {};
// ZoomToMaxExtent control, a "button" control
action = new GeoExt.Action({
control: new OpenLayers.Control.ZoomToMaxExtent(),
map: map,
text: "Pokaż wszystko",
tooltip: "zoom to max extent"
});
actions.max_extent = action;
toolbarItems.push(action);
toolbarItems.push("-");
// Navigation history - two "button" controls
ctrl = new OpenLayers.Control.NavigationHistory();
map.addControl(ctrl);
action = new GeoExt.Action({
text: "