Windows Phone 7 Bing Maps Control
-
Upload
chris-pendleton -
Category
Technology
-
view
9.001 -
download
2
description
Transcript of Windows Phone 7 Bing Maps Control
Bing Maps for Windows Phone 7Chris Pendleton(Ex) Bing Maps Technical EvangelistMicrosoft Corporation@ChrisPendleton
Agenda
Bing Maps – Content– APIs– Infrastructure
Windows Phone 7 Control– Classes– Coding
Q&A
Content: Geocoding
Over 85 million parcel centroids in US Parcel centroids in Japan and
Germany now live Parcels provide a high level of
accuracy Falls back to interpolation Bulk geocoding available No daily limits on geocoding
Content: Maps
Road data mostly from NAVTEQ. Highway or Capital coverage for
every country in the world; street level data for 37 countries
Full Bing list of coverage.
Content: Maps
New Map Style
Content: Aerial
Uses a combination of satellite and aerial photos up to 12 inches per pixel.
Flying Global Ortho Project to provide 12 inch resolution photos for all 48 lower states and W. Europe
Refresh rate every 2-3 years Partner: Digital Globe
Content: Routing
Shortest, fastest, walking and traffic-based
Offers route geometry for spatial queries
Content: Search
Yellow Page listings available via map API
Nearly 20 million listings available
Developer APIs
AJAX API Silverlight Control SOAP Service ReST Service Bing Map App API Spatial Data API
Infrastructure
Content (tiles and controls) worldwide deployment across Azure Content Delivery Network
Services deployed across Azure Dynamic Compute Network
Windows Phone 7 Bing Maps Control
Native to WP7 SDK (Woohoo!) Based on Bing Maps Silverlight
Control Some features removed (for perf) Some features added (for device) Some class changes (for conflict)
New Classes
Class Features
MapAutomationPeer Handlers for interacting with the device - DoubleTap, Drag, Flick, Scale, Zoom
MapDragEventsArgs Measures screen distance - DragDelta
MapFlickEventArgs Measures screen distance - Velocity
MapInputEventArgs Map events – Handled, ViewportPoint
MapZoomEventArgs Touch zoom events – ZoomDelta
MatrixHelper Device movements – Rotate, Rotate at, Translate
Overlay Controls atop the map – FireTemplateApplied, TemplateApplied
ZoomBar Controls the zoom bar – OnApplyTemplate, OnZoomMap, ZoomMap
Maps.Platform Classes
Class Features
Location Defines lat/lon
Rectangle Northeast and Southwest map corners
ShapeBase Serialization
Setting Centerpoint (C#)
using Microsoft.Phone.Controls.Maps;using System.Device.Location;
namespace WindowsPhoneApplication1{ public partial class MainPage : PhoneApplicationPage { // Constructor public MainPage() { InitializeComponent(); map1.SetView(new GeoCoordinate(42.123, -120.123), 17); }}}
Change Map Styles (C#)
using Microsoft.Phone.Controls.Maps;using System.Device.Location;
namespace WindowsPhoneApplication1{… private void button1_Click(object sender, RoutedEventArgs e) {
if (map1.Mode is RoadMode) { map1.Mode = new AerialMode(true); } else { map1.Mode = new RoadMode(); } }…}
Set Map Properties (XAML)
… xmlns:my="clr-namespace:Microsoft.Phone.Controls.Maps;assembly=Microsoft.Phone.Controls.Maps">
<!--LayoutRoot is the root grid where all page content is placed--> <Grid x:Name="LayoutRoot" Background="Transparent"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title--> <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28"> <TextBlock x:Name="ApplicationTitle" Text="CP's Mapplication" Style="{StaticResource PhoneTextNormalStyle}"/> <TextBlock x:Name="PageTitle" Text="My Maps!" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/> </StackPanel>
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<my:Map Height="503" HorizontalAlignment="Left" Margin="9,6,0,0" Name="map1" VerticalAlignment="Top" Width="447" ZoomBarVisibility="Visible" Mode="Aerial" CredentialsProvider=“[BINGMAPSKEY]"/> <Button Content="Switch Map Styles" Height="72" HorizontalAlignment="Left" Margin="69,534,0,0" Name="button1" VerticalAlignment="Top" Width="337" Click="button1_Click" /> </Grid> </Grid>
Hello World
1. Load Map
Switch Map Modes
1. Loads Map Control2. Specifies Center Point3. Specifies Map Mode4. Button switches map
style
Locate Me Using GPS
1. Load Map2. Access GPS3. Re-center and Zoom
Map
Using Shapes
1. Load Map2. Re-center and Zoom
Map3. Draw Polygon
Which API is Right for You?
Surface
Mobile
PC
Browser
AJAX Map Control
Silverlight Control
SOAP Services
REST Services
Map App SDK
Bing
Map
s Pl
atfor
m
Customer Servers
End User
www.bing.com/maps
MapPoint Web Services
+ Data Source
Next Steps
Download WP7 SDK Get a Bing Maps Key at
BingMapsPortal.com Reference the WP7 Docs Reference the Bing Maps Silverlight
Control docs Build a killer app!
Q&A
Yes, it’s free for native mobile apps (all platforms)
Yes, it’s free on the web…for the most of you
Yes, it’s free for education and NFP It’s all free unless…you exceed usage
thresholds on the web
© 2010 Microsoft Corporation. All rights reserved.This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.