Scale bar

While we're at it, let's add a scale bar to our map so that users can get a sense of distances:

  1. In MainWindow.xaml, add the following after the legend code:
    <toolkit:ScaleLine Scale="{Binding ElementName=MyMapView,  
        Path=Scale}"
        HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="10" />
  2. Run the app and you will see a scale bar like the following screenshot in the lower-right corner of the map:
    Scale bar

Make sure to zoom in and out and you'll note that it changes, depending on the scale of the map. Once again, ScaleLine has a property called Scale, which binds to the Scale property of MapView. As we discussed in Chapter 4, From 2D to 3D, there is no such thing as scale in 3D, so this control won't work in SceneView.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.141.27