Skip to content
This repository has been archived by the owner on Aug 21, 2019. It is now read-only.

zoom out is too much #35

Open
siddharth251189 opened this issue Jul 7, 2015 · 0 comments
Open

zoom out is too much #35

siddharth251189 opened this issue Jul 7, 2015 · 0 comments

Comments

@siddharth251189
Copy link

when i am implementing plugin for zoom ,by default the zoom out is too much which makes it to small to view.

how to resolve it.

I am using below code :

        $(document).ready(function() {

            $('#canvas').smartZoom({'containerClass':'zoomableContainer'});

            $('#topPositionMap,#leftPositionMap,#rightPositionMap,#bottomPositionMap').bind("click", moveButtonClickHandler);
            $('#zoomInButton,#zoomOutButton').bind("click", zoomButtonClickHandler);

            function zoomButtonClickHandler(e){
                var scaleToAdd = 20;

                if(e.target.id == 'zoomOutButton')
                    scaleToAdd = -scaleToAdd;
                $('#canvas').smartZoom('zoom', scaleToAdd);
            }

            function moveButtonClickHandler(e){
                var pixelsToMoveOnX = 0;
                var pixelsToMoveOnY = 0;

                switch(e.target.id){
                    case "leftPositionMap":
                        pixelsToMoveOnX = 100;  
                    break;
                    case "rightPositionMap":
                        pixelsToMoveOnX = -50;
                    break;
                    case "topPositionMap":
                        pixelsToMoveOnY = 50;   
                    break;
                    case "bottomPositionMap":
                        pixelsToMoveOnY = -50;  
                    break;
                }
                $('#canvas').smartZoom('pan', pixelsToMoveOnX, pixelsToMoveOnY);
            }

        });
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant