| | 838 | /** Zoom to a specific zoom level |
|---|
| | 839 | * |
|---|
| | 840 | * @param {int} zoom |
|---|
| | 841 | */ |
|---|
| | 842 | zoomTo: function(zoom) { |
|---|
| | 843 | this.setCenter(null, zoom); |
|---|
| | 844 | }, |
|---|
| | 845 | |
|---|
| | 846 | /** |
|---|
| | 847 | * @param {int} zoom |
|---|
| | 848 | */ |
|---|
| | 849 | zoomIn: function() { |
|---|
| | 850 | this.zoomTo(this.getZoom() + 1); |
|---|
| | 851 | }, |
|---|
| | 852 | |
|---|
| | 853 | /** |
|---|
| | 854 | * @param {int} zoom |
|---|
| | 855 | */ |
|---|
| | 856 | zoomOut: function() { |
|---|
| | 857 | this.zoomTo(this.getZoom() - 1); |
|---|
| | 858 | }, |
|---|
| | 859 | |
|---|
| | 860 | /** Zoom to the passed in bounds, recenter |
|---|
| | 861 | * |
|---|
| | 862 | * @param {OpenLayers.Bounds} bounds |
|---|
| | 863 | */ |
|---|
| | 864 | zoomToExtent: function(bounds) { |
|---|
| | 865 | this.setCenter(bounds.getCenterLonLat(), |
|---|
| | 866 | this.getZoomForExtent(bounds)); |
|---|
| | 867 | }, |
|---|
| | 868 | |
|---|
| | 869 | /** Wrapper to maintain defined API functionality. |
|---|
| | 870 | * zoomToMaxExtent() should be used from now on. |
|---|
| | 871 | * |
|---|
| | 872 | * @deprecated |
|---|
| | 873 | */ |
|---|
| | 874 | zoomToFullExtent: function() { |
|---|
| | 875 | this.zoomToMaxExtent(); |
|---|
| | 876 | }, |
|---|
| | 877 | |
|---|
| | 878 | /** Zoom to the full extent and recenter. |
|---|
| | 879 | */ |
|---|
| | 880 | zoomToMaxExtent: function() { |
|---|
| | 881 | this.zoomToExtent(this.getMaxExtent()); |
|---|
| | 882 | }, |
|---|
| | 883 | |
|---|
| 854 | | |
|---|
| 855 | | }, |
|---|
| 856 | | |
|---|
| 857 | | /** Zoom to a specific zoom level |
|---|
| 858 | | * |
|---|
| 859 | | * @param {int} zoom |
|---|
| 860 | | */ |
|---|
| 861 | | zoomTo: function(zoom) { |
|---|
| 862 | | this.setCenter(null, zoom); |
|---|
| 863 | | }, |
|---|
| 864 | | |
|---|
| 865 | | /** |
|---|
| 866 | | * @param {int} zoom |
|---|
| 867 | | */ |
|---|
| 868 | | zoomIn: function() { |
|---|
| 869 | | this.zoomTo(this.getZoom() + 1); |
|---|
| 870 | | }, |
|---|
| 871 | | |
|---|
| 872 | | /** |
|---|
| 873 | | * @param {int} zoom |
|---|
| 874 | | */ |
|---|
| 875 | | zoomOut: function() { |
|---|
| 876 | | this.zoomTo(this.getZoom() - 1); |
|---|
| 877 | | }, |
|---|
| 878 | | |
|---|
| 879 | | /** Zoom to the passed in bounds, recenter |
|---|
| 880 | | * |
|---|
| 881 | | * @param {OpenLayers.Bounds} bounds |
|---|
| 882 | | */ |
|---|
| 883 | | zoomToExtent: function(bounds) { |
|---|
| 884 | | this.setCenter(bounds.getCenterLonLat(), |
|---|
| 885 | | this.getZoomForExtent(bounds)); |
|---|
| 886 | | }, |
|---|
| 887 | | |
|---|
| 888 | | /** Wrapper to maintain defined API functionality. |
|---|
| 889 | | * zoomToMaxExtent() should be used from now on. |
|---|
| 890 | | * |
|---|
| 891 | | * @deprecated |
|---|
| 892 | | */ |
|---|
| 893 | | zoomToFullExtent: function() { |
|---|
| 894 | | this.zoomToMaxExtent(); |
|---|
| 895 | | }, |
|---|
| 896 | | |
|---|
| 897 | | /** Zoom to the full extent and recenter. |
|---|
| 898 | | */ |
|---|
| 899 | | zoomToMaxExtent: function() { |
|---|
| 900 | | this.zoomToExtent(this.getMaxExtent()); |
|---|
| 901 | | }, |
|---|
| 902 | | |
|---|
| | 901 | }, |
|---|
| | 902 | |
|---|