Select to view content in your preferred language

How to limit the location of camera

738
2
08-02-2018 01:51 AM
wangchao1
Emerging Contributor

I'm  using sceneView to make 3D map,now I need to limit the camera of the sceneView,so that the target I'm looking at will not go outside the screen when I drag or zoom the map.

Now I have find a block of sceneView named "viewpointChangedHandler" can do what I want,but I don't think it can do what I want very good. Is there a property just like maxScale or minScale that the AGSMapView have to limit the AGSSceneView zoom or drag.

0 Kudos
2 Replies
DiveshGoyal
Esri Regular Contributor

Have you considered using the orbit-location camera controller? ArcGIS Runtime SDK for iOS: AGSOrbitLocationCameraController Class Reference 

It locks the camera to a target location and then pan/zoom operations are tied to that location

0 Kudos
wangchao1
Emerging Contributor

I have  try it. but it can't drag the map by X or Y,it can only route around the target.sometime I need to drag the map ,so I give up  the orbit-location camera controller.If there is no properties I need,how can I stop the drag or zoom  gesture when I know it is outside the screen by the  viewpointChangedHandler block?

0 Kudos