Sample code to render a slider outside the map viewport:
var slider = new GeoExt.ZoomSlider({
renderTo: document.body,
width: 200,
map: map
});
Sample code to add a slider to a map panel:
var panel = new GeoExt.MapPanel({
renderTo: document.body,
height: 300,
width: 400,
map: {
controls: [new OpenLayers.Control.Navigation()]
},
layers: [new OpenLayers.Layer.WMS(
"Global Imagery",
"http://maps.opengeo.org/geowebcache/service/wms",
{layers: "bluemarble"}
)],
extent: [-5, 35, 15, 55],
items: [{
xtype: "gx_zoomslider",
aggressive: true,
vertical: true,
height: 100,
x: 10,
y: 20
}]
});
Configuration properties in addition to those listed for Ext.slider.SingleSlider.
Public methods in addition to those listed for Ext.slider.SingleSlider.
Returns: | Number The map resolution. |
---|
Get the resolution for the associated map based on the slider value.
Returns: | Number The map scale denominator. |
---|
Get the scale denominator for the associated map based on the slider value.
Returns: | Number The map zoom level. |
---|
Get the zoom level for the associated map based on the slider value.