public void setNavigationAddonEnabled ( boolean enabled ) { navigationAddonEnabled = enabled ; final String panId = "panBTNCollection" ; final String zoomId = "zoomAddon" ; final String zoomRectId = "zoomRectAddon" ; if ( enabled ) { if ( ! getMapAddons ( ) . containsKey ( panId ) ) { PanButtonCollection panButtons = new PanButtonCollection ( panId , this ) ; panButtons . setHorizontalMargin ( 5 ) ; panButtons . setVerticalMargin ( 5 ) ; registerMapAddon ( panButtons ) ; } if ( ! getMapAddons ( ) . containsKey ( zoomId ) ) { ZoomAddon zoomAddon = new ZoomAddon ( zoomId , this ) ; zoomAddon . setHorizontalMargin ( 20 ) ; zoomAddon . setVerticalMargin ( 65 ) ; registerMapAddon ( zoomAddon ) ; } if ( ! getMapAddons ( ) . containsKey ( zoomRectId ) ) { ZoomToRectangleAddon zoomToRectangleAddon = new ZoomToRectangleAddon ( zoomRectId , this ) ; zoomToRectangleAddon . setHorizontalMargin ( 20 ) ; zoomToRectangleAddon . setVerticalMargin ( 135 ) ; registerMapAddon ( zoomToRectangleAddon ) ; } } else { unregisterMapAddon ( addons . get ( panId ) ) ; unregisterMapAddon ( addons . get ( zoomId ) ) ; unregisterMapAddon ( addons . get ( zoomRectId ) ) ; } }
Enables or disables the panning buttons . This setting has immediate effect on the map .