Skip to content

Instantly share code, notes, and snippets.

@elbruno
Created October 11, 2017 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elbruno/428aa4877d9e590ded7080f6a8ebb620 to your computer and use it in GitHub Desktop.
Save elbruno/428aa4877d9e590ded7080f6a8ebb620 to your computer and use it in GitHub Desktop.
SurfaceDialMapControlZoom
readonly RadialController _controller;
public MapPagePage()
{
locationService = new LocationService();
Center = new Geopoint(defaultPosition);
ZoomLevel = DefaultZoomLevel;
InitializeComponent();
_controller = RadialController.CreateForCurrentView();
_controller.RotationResolutionInDegrees = 0.2;
_controller.UseAutomaticHapticFeedback = false;
var myItem = RadialControllerMenuItem.CreateFromFontGlyph("El Bruno - Maps", "\xE128", "Segoe MDL2 Assets" );
_controller.Menu.Items.Add(myItem);
_controller.ButtonClicked += ControllerButtonClicked;
_controller.RotationChanged += ControllerRotationChanged;
}
private void ControllerRotationChanged(RadialController sender, RadialControllerRotationChangedEventArgs args)
{
Debug.WriteLine($"{mapControl.ZoomLevel} - {args.RotationDeltaInDegrees}");
mapControl.ZoomLevel = mapControl.ZoomLevel + args.RotationDeltaInDegrees;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment