The solutions here left me with 2 issues. First of all, if you held down the arrow key so that it started panning rapidly, when it hit the edge, it wouldn't go all the way to the edge because due to the panning acceleration taking large "steps", the next "step" would have gone outside the bounds, so it doesn't take that last "step". So once it stopped, you could release the arrow key and then press it again, and it would pan just a little bit further.
4 Answers, 1 is accepted
Thank you for your interest.
What I can suggest is to take advantage of the ViewChanged command and coerce the NewCenter value when it is out of the desired bounds.
Regards,
Ivaylo Gergov
Telerik
The solutions here left me with 2 issues. First of all, if you held down the arrow key so that it started panning rapidly, when it hit the edge, it wouldn't go all the way to the edge because due to the panning acceleration taking large "steps", the next "step" would have gone outside the bounds, so it doesn't take that last "step". So once it stopped, you could release the arrow key and then press it again, and it would pan just a little bit further. |
The solutions here left me with 2 issues. First of all, if you held down the arrow key so that it started panning rapidly, when it hit the edge, it wouldn't go all the way to the edge because due to the panning acceleration taking large "steps", the next "step" would have gone outside the bounds, so it doesn't take that last "step". So once it stopped, you could release the arrow key and then press it again, and it would pan just a little bit further. |
The solutions here left me with 2 issues. First of all, if you held down the arrow key so that it started panning rapidly, when it hit the edge, it wouldn't go all the way to the edge because due to the panning acceleration taking large "steps", the next "step" would have gone outside the bounds, so it doesn't take that last "step". So once it stopped, you could release the arrow key and then press it again, and it would pan just a little bit further. |
The question and solution are related to limiting the region the user can pan to. For example, if your map was 1000px wide and you only want the user to be able to pan up to 250px of the edge.
The solution is to re-center the map programmatically when the user tries panning to an area you don't want them to go.
Can you please clarify what it is you seek help for so that we can better assist you?
Regards,
Lance | Tech Support Engineer, Sr.
Telerik by Progress