Q3.
Maps and Le oation
The Maps App in a windows phone can shoW you whn
you are, whee you want to go and provioa
direcha to qet you thee.
St canalso show you raarby shops or reataurants
you might be interested in and what other people
Saying about then
For displaying map in your windows phon,use
the TMap cantal.
USe the contol you have to select the
ID-CAP-MAP capabilihy in the app manifest fle
The followinq coole example shous how you can Use
XML to display map Conhol in yoUr Winalows Phore &
app
<--Content Ponel- place addihonal content here --)
<and x:Name= "Content Parel qrid. Row = "1
Margin = n, o, 12, o">
(maps Map /)
<larid)
Sf you add the cenhol bsiAg by wrihng XATML, you.
also have to add the foltouing xmlns oleclarohion
to phonei PhoneAppli cahion Pag e element
Jf yeu crag the and drop the
3f Map conhol
conbal fom he
toolbox this dluclaration is adoled cwto matically
a map with caole CC+)
Displaying
how you can dlisply
The following code example ahows Phon&
a Map conol in your Windows app
USing Mioosoft. Phane Maps. Contral
Map my Map = Tlap C)i
Content Pand. Childn Add CMyMap)
Displaying a Tlap using Bult-in kauncher ’
The ollo wing is a list of all he built in launchers
that display or manage mapsi
Mapstuk kaunchal the built- in Maps app nd
optionally marks a locathion
Maps direchion tosk hawnches the built in Maps aon
and displays direchion s.
lap Dounlaadu task Downlo adt maps for offline use
Map Updlater talk hacks for updatel or offine maps
that the user had preiously
downloadd.
Specifying the cnter of the map (XAML) ’
You can st the centu of the map conhol by using the
Center proputy to which we
auign a (atitude , longihodd
pair
<E- Cortent Panel place adalitional cantent he)
<Grid Content Ponel" Crid.Row ="1
TMargin ="/2, 40, 12, o"
<maps Map x:Name= " Mylap" Cuntr =" 42.61, 22.33/N
Specifying thehe zo0m levl ofa map XAM)
This can be done vsing the Zaomuvel pro perty to se
the inihal resoluhon o which you uant o ali'splay the ap
Page
K!-- Contnt Panel - place addi tional cantunt hn)
<arid X: Noume = ' Cont A
Parnw" Grid. Row="1"
Margin = ")2.0, 12,0">
<maps Map X: Name="y Map Center = 44.61, 122.33"
nZoom Aerel = "lo"/
Displaying kandmarks and Pedestricn er featured
Set the Landmans Enabled property to thue to disploy
landmarks on he map contolL
hand marks Ove Visible on dhe map only when oomLevel
proputy is Set to a value of I6 or tigher
Feature
Set the Pedestian, Enabied prapurty to tm to displouy
pedestian fatru such al. public stairs
Pedesian featoret are visible on the map only when Hhe
Set toJ6 or
00mlevelis
higher.
<!- Conteat Panel - place aoleliional cantunt her
KGid X: Name= ContentPanel" Grid. Row = "1"
TMargin kR,0,12,0")
Kmaps Map X:Nome=MyTMap Centr ="47.6L122.33
Zoomevele "l6 ", Landmarks Enabled =hue"
Pedestrian features Enabled "we'
Page
Setting the carto graphic mode ’
typel of cartographic mocles Supported includle -
1 Road-disploys the nomal dfault 2D map
2 deial- oisplays an auial photagraphic map
3. Hybrid- displays an luial view map overlayed
with roacs and labels
4. Temain - displays physical rlief imag u, for displaying
devation cnd water faturel (eg. mountaina
andrivrs)
The defawt is Roadmode.
Sething the color modle -
You can display the mop in light color mode or
dark color mede by using the ColorTMo de proputy
This propety can take the values klght and Dark