本文整理汇总了C#中MapView.GetCameraAsync方法的典型用法代码示例。如果您正苦于以下问题:C# MapView.GetCameraAsync方法的具体用法?C# MapView.GetCameraAsync怎么用?C# MapView.GetCameraAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MapView
的用法示例。
在下文中一共展示了MapView.GetCameraAsync方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnClick
protected override async void OnClick()
{
activeMapView = ProSDKSampleModule.ActiveMapView;
Camera camera = await activeMapView.GetCameraAsync() ;
bool is2D = false ;
try {
is2D = activeMapView.ViewMode == ViewMode.Map;
}
catch(System.ApplicationException) {
return ;
}
if (is2D)
{
// in 2D we are changing the scale
double scaleStep = camera.Scale / _zoomSteps;
camera.Scale = camera.Scale + scaleStep;
}
else
{
// in 3D we are changing the Z-value and the pitch (for drama)
double heightZStep = camera.Z / _zoomSteps;
double pitchStep = 90.0 / _zoomSteps;
camera.Pitch = camera.Pitch + pitchStep;
camera.Z = camera.Z + heightZStep;
}
// the heading changes the same in 2D and 3D
camera.Heading = HollywoodZoomUtils.StepHeading(camera.Heading, -30);
// assign the changed camera back to the view
activeMapView.ZoomToAsync(camera);
}