The function navigation provided by Bing Maps Silverlight Control is very powerful. In terms of design, it provides great support for extensions and provides commands and buttons that can be extended and directly used by many users, if you are not clear, you can view the article "Custom navigation bar" that I wrote earlier. However, compared with the functional navigation menu provided in DeepEarth, the menu is not so bold and dynamic. I personally prefer the functional navigation menu in DeepEarth. First, let's take a look at the default function navigation menu of Bing Maps:
I have received a number of emails about how to implement navigation menu effects similar to DeepEarth in Bing Maps Silverlight Control development over the past few days, it is very easy to reply to the navigation menu to implement the DeepEarth effect in the email. We do not have to bother developing such controls, because the latest DeepEarth extension for Bing Maps already provides the function Navigation Control (NavigationPanel) for extending Bing Maps ). The following solutions are available:
For the preceding solution, you only need to reference the DeepEarth source code or released. dll assembly to the project to use its control. Of course, you must add a reference to the control before using it:
Xmlns: m = "clr-namespace: Microsoft. Maps. MapControl; assembly = Microsoft. Maps. MapControl"
Xmlns: dp = "clr-namespace: DeepEarth. Client. Controls. DEMap; assembly = DeepEarth. Client. Controls. DEMap. NavigationPanel">
The navigation menu Control provided by DeepEarth is actually an extension of Bing Maps Silverlight Control. The use of the Control is the same as that directly used in DeepEarth, if you have never used the DeepEarth function navigation menu control, you can refer to the detailed introduction in exploring the DeepEarth built-in control. The DeepEarth used in Bing Maps is the extended NavigationPanel of Bing Maps. However, you must specify a MapName attribute for the extended NavigationPanel. The value of this MapName attribute is the Name of the object of Bing Maps Silverlight Control, deepEarth is added to Bing Maps Silverlight Control by specifying the Bing Maps Name, the default navigation menu of Bing Maps Silverlight Control only needs to be set to not displayed (Collapsed. The following code block:
<Grid x: Name = "LayoutRoot" Width = "500" Height = "420">
<M: Map x: Name = "map" Margin = "0, 0, 0" CredentialsProvider = "{StaticResource MyCredentials }"
NavigationVisibility = "Collapsed">
</M: Map>
<Dp: NavigationPanel x: Name = "navPanel" MapName = "map" Margin = "4, 4, 4"
HorizontalAlignment = "Left"
VerticalAlignment = "Top">
<StackPanel Orientation = "Horizontal">
<Button x: Name = "btnBeiJing" Content = "Chongqing" Width = "60"
Style = "{StaticResource StandardButton }"
Click = "btnChongQing_Click"
Margin = "3,3, 3,3"> </Button>
</StackPanel>
</Dp: NavigationPanel>
</Grid>
A button is displayed in the navigation menu of the above function. This button enables the map to be dynamically located in the region of Chongqing. The positioning code is very simple and you can set the central point of the map directly. The following code block:
Private void btnChongQing_Click (object sender, RoutedEventArgs e)
{
Map. Center = new Microsoft. Maps. MapControl. Location (29.5076372217973, 106.489384971208 );
Map. ZoomLevel = 10;
}
Copyright description
This article is an original article. You are welcome to repost it and indicate the source of the Article. Its copyright belongs to the author and the blog Park.
Author: Beniao, Microsoft Bing Maps Development Group: 75662563
Article Source: http://beniao.cnblogs.com/or http://www.cnblogs.com/