{"action":"created","issue":{"url":"https://api.github.com/repos/moagrius/TileView/issues/174","labels_url":"https://api.github.com/repos/moagrius/TileView/issues/174/labels{/name}","comments_url":"https://api.github.com/repos/moagrius/TileView/issues/174/comments","events_url":"https://api.github.com/repos/moagrius/TileView/issues/174/events","html_url":"https://github.com/moagrius/TileView/issues/174","id":76247598,"number":174,"title":"setScaleLimit does not work with setScaleToFit(false)","user":{"login":"reachingyu","id":3440261,"avatar_url":"https://avatars.githubusercontent.com/u/3440261?v=3","gravatar_id":"","url":"https://api.github.com/users/reachingyu","html_url":"https://github.com/reachingyu","followers_url":"https://api.github.com/users/reachingyu/followers","following_url":"https://api.github.com/users/reachingyu/following{/other_user}","gists_url":"https://api.github.com/users/reachingyu/gists{/gist_id}","starred_url":"https://api.github.com/users/reachingyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reachingyu/subscriptions","organizations_url":"https://api.github.com/users/reachingyu/orgs","repos_url":"https://api.github.com/users/reachingyu/repos","events_url":"https://api.github.com/users/reachingyu/events{/privacy}","received_events_url":"https://api.github.com/users/reachingyu/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/moagrius/TileView/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-14T06:05:54Z","updated_at":"2015-05-14T18:04:29Z","closed_at":null,"body":"I am trying to set the minimum scale for my map using setScaleLimit and setScaleToFit. I have read previous closed issues on setScaleToFit and how setScaleLimit should be respected if setScaleToFit is false. However, when I pinch zoom out on my map, it can zoom out all the way to 0 (disappear) without respecting the minimum limits.  Why is this? and how can I prevent this from happening?\r\n\r\nHere is my code: \r\n\r\n{\r\n    mInflater = inflater;\r\n    mView = inflater.inflate(R.layout.fragment_match, container);\r\n\r\n    mTileView = new TileView(getActivity());\r\n    mTileView.setDecoder(new BitmapDecoderAssets());\r\n\r\n    mTileView.setSize(4096, 3813);\r\n\r\n    mTileView.addDetailLevel(0.125f, \"tiles/map/125_%col%_%row%.png\", \"samples/map_real_android.png\");\r\n    mTileView.addDetailLevel(0.25f, \"tiles/map/250_%col%_%row%.png\", \"samples/map_real_android.png\");\r\n    mTileView.addDetailLevel(0.5f, \"tiles/map/500_%col%_%row%.png\", \"samples/map_real_android.png\");\r\n    mTileView.addDetailLevel(1f, \"tiles/map/1000_%col%_%row%.png\", \"samples/map_real_android.png\");\r\n\r\n    mTileView.setScale(0.49);\r\n    mTileView.setScaleLimits(0.3, 0.49);\r\n    mTileView.setScaleToFit(false);\r\n    mTileView.setId(R.id.map);\r\n\r\n    RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(\r\n        RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);\r\n    ((RelativeLayout) mView).addView(mTileView, lp);\r\n\r\n    return mView;\r\n }\r\n\r\nMy map in full screen:\r\n![screen shot 2015-05-13 at 10 56 21 pm](https://cloud.githubusercontent.com/assets/3440261/7626787/60309018-f9c3-11e4-8b07-aae04ab1f9a5.png)\r\n\r\nMy map when zoomed out:\r\n![screen shot 2015-05-13 at 10 59 36 pm](https://cloud.githubusercontent.com/assets/3440261/7626853/66a87a18-f9c4-11e4-8354-0a995488c3bd.png)\r\n\r\nMy (desired) zoom out size/scale:\r\n![screen shot 2015-05-13 at 11 01 13 pm](https://cloud.githubusercontent.com/assets/3440261/7626856/78a805d0-f9c4-11e4-9fd3-9eb64689f8f0.png)\r\n\r\nThank you! \r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/moagrius/TileView/issues/comments/102120100","html_url":"https://github.com/moagrius/TileView/issues/174#issuecomment-102120100","issue_url":"https://api.github.com/repos/moagrius/TileView/issues/174","id":102120100,"user":{"login":"reachingyu","id":3440261,"avatar_url":"https://avatars.githubusercontent.com/u/3440261?v=3","gravatar_id":"","url":"https://api.github.com/users/reachingyu","html_url":"https://github.com/reachingyu","followers_url":"https://api.github.com/users/reachingyu/followers","following_url":"https://api.github.com/users/reachingyu/following{/other_user}","gists_url":"https://api.github.com/users/reachingyu/gists{/gist_id}","starred_url":"https://api.github.com/users/reachingyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reachingyu/subscriptions","organizations_url":"https://api.github.com/users/reachingyu/orgs","repos_url":"https://api.github.com/users/reachingyu/repos","events_url":"https://api.github.com/users/reachingyu/events{/privacy}","received_events_url":"https://api.github.com/users/reachingyu/received_events","type":"User","site_admin":false},"created_at":"2015-05-14T18:04:29Z","updated_at":"2015-05-14T18:04:29Z","body":"Thank you for the explanation! Your solution works for me. "}}