To be able to integrate a Map control into your new app that is going to make use of HERE Maps, it’s firstly necessary to enable the application ID_CAP_MAP attribute, which can be found in the WMAppManifest.xml file. This will grant your app the capability of using the maps contained in your phone (or the rights to download them on the spot from the Internet, as well).
Without this first step, your app will be relentlessly crashing again and again, so (pretty please) don’t miss it 😉
This done, you’ll need to manage an import to actually be able to place your Map into the XAML file. The import is made adding this line of code:
Now we can create the map! This is the code for it:
At this point, should you decide running your app “as it is”, you’ll have just your map (supposing you have placed nothing else but it) with its basic settings. Basically it’s like opening HERE Maps, no more.
Should you want to customize your map behaviour, these are the properties that are avalaible and that you NEED to know:
- ZoomLevel (1-20, 1 being the zoom level most zoomed out)
- Heading (Directional heading pointing “up” on the map – N = 0, E = 90, S = 180, W = 270)
- Pitch (the tilt of the map, the inclination you see the map at, from perpendicular all the way to parallel)
- CartographicMode (road, aerial, hybrid, terrain)
- ColorMode (light and dark – effect on road cartographic mode only)
- LandmarksEnabled (displays 3-D object of prominent buildings and landmarks overlayed on the map when enabled)
- PedestrianFeaturesEnabled (displays pedestrian features such as stairs when enabled)
You may set these attributes either directly into your XAML code or access them from the C# code.
Happy mapping! 😉