46

Mapping & Locations on Windows 10

Embed Size (px)

Citation preview

Page 1: Mapping & Locations on Windows 10
Page 2: Mapping & Locations on Windows 10

Mapping & Locations in Windows10

Joost van Schaik, WPDev MVP

Page 3: Mapping & Locations on Windows 10

Hello• Joost van Schaik aka LocalJoost• Senior (Business Apps) developer • 23 jaar in (Geo)-ICT• Windows Platform Development MVP• ‘Unofficial Maps MVP’• Voormalig Nokia Developer Champion• 5 open sources libraries, 2 nog actief

Page 4: Mapping & Locations on Windows 10
Page 5: Mapping & Locations on Windows 10
Page 6: Mapping & Locations on Windows 10
Page 7: Mapping & Locations on Windows 10
Page 8: Mapping & Locations on Windows 10

</commercials></plugs><contents>

Page 9: Mapping & Locations on Windows 10

Agenda• What’s new• Basis kaart manipulatie• Tekenen op de kaart• Geofencing• Geocoding, Routing• Location Tracking• 3D• Tile sets

Page 10: Mapping & Locations on Windows 10
Page 11: Mapping & Locations on Windows 10

ConvergentieKaart vorig jaar beetje ondergeschoven kindjeNu:• Eén component• Eén API

Met dank aan Universal Windows Platform apps

Page 12: Mapping & Locations on Windows 10

Nieuw• Eén API en component – wel weer een nieuw

control• Windows.UI.Xaml.Controls.Maps.MapControl

• In principe: UWP API = Windows Phone 8.1 Universal apps

• System wide offline maps• MapIcons meer bruikbaar• 3D maps• Streetside maps• Background location tracking• Div kleine API uitbreidingen en wijzingen, m.n.

rondom Geolocation

Page 13: Mapping & Locations on Windows 10

Map service Authentication Token“Map service ApplicationID: Map service AuthenticationToken”• MapControl.MapServiceToken• MapService.ServiceToken

Bing Maps portal of dev portal

Page 14: Mapping & Locations on Windows 10

Capabilities• ID_CAP_MAP is er niet meer• DeviceCapability Name="location“• Capability Name="internetClient“• <Extension

Category="windows.backgroundTasks“EntryPoint= "WalkingDownCanalStreet.Background.AlertTask"> <BackgroundTasks> <Task Type="location" /> </BackgroundTasks></Extension>

• ToastCapable niet meer nodig

Page 15: Mapping & Locations on Windows 10

Demo 1 - BasisBasis kaart manipulatieTekenen punten, lijnen en vlakkenData koppelen en opvragen

Page 16: Mapping & Locations on Windows 10

Basis

• Basis kaart manipulatie• Vele manieren om in te zoomen

• Tekenen shapes• MapIcon werkt nu ook• Best effort drawing is uit te zetten• Tip: zorg dat je icons vierkant zijn (anders klopt

anchor niet)• Style• Landmarks e.d.• ADP koppeling geometrie -> object

lessons learned

Page 17: Mapping & Locations on Windows 10

Geofencing

Page 18: Mapping & Locations on Windows 10

Geofencing

“Geofencing is a technology that defines a virtual boundary around a real-world geographical area. In doing so, a radius of interest is established that can trigger an action in a geo-enabled phone or other portable electronic device.”

Thus speaketh Technopediahttp://www.techopedia.com/definition/14937/geofencing

Page 19: Mapping & Locations on Windows 10

Waarom?

• Notificatie als je ergens in de buurt komt• Of als je weggaat• Of als je kind/vriend(in)/echtgeno(o)t(e)

ergens in de buurt komt….

Page 20: Mapping & Locations on Windows 10

Foreground & background?

• Geofencing in actieve app• Geofencing in background task• Kies één van beide scenario's

Page 21: Mapping & Locations on Windows 10

Walking down Canal street…

Page 22: Mapping & Locations on Windows 10

Demo 2 - GeofencingRestaurants in de Utrechtse Kanaalstraat

Page 23: Mapping & Locations on Windows 10

Geofencing

• Registratie background task• Implicaties WinRt component (sealed,

IAsyncOperation)• LocationTrigger: 1x per 2 minuten max• Niet zo geschikt voor high-speed real time

tracking kleine gebieden• Toast capable niet meer nodig in UWP!• Capabilities/Location• Dwell time! (default 10s)• Alleen cirkels (?)

Lessons learned

Page 24: Mapping & Locations on Windows 10

En verder

• Niet bar veel gewijzigd, geofencing API was al ‘gedeeld’

• Demo geofencing trigger is nog steeds vragen om moeilijkheden

Page 25: Mapping & Locations on Windows 10

Tips & tricks

• Route mode• Meerdere korte simulaties• Initiële positie opzetten dan pas geofences• Verse start per test• Scheur niet op hoge snelheid door kleine

geofences (of hoge dwell time)

niet nieuw wel belangrijk

Page 26: Mapping & Locations on Windows 10

Demo 3 – Routing, trackingBackground!

Page 27: Mapping & Locations on Windows 10

Routing & tracking

• MapLocationFinder, MapRouteFinder• (Eindelijk) weer background location tracking• ExtendedExecutionSession• Geoposition uit Geolocator heeft nu Geopoint

“Coordinate.Point” • dus geen conversie

Lessons learned

Page 28: Mapping & Locations on Windows 10

Demo 4 - 3D“Dan liever de lucht in”

Page 29: Mapping & Locations on Windows 10

3D

• 3D werkt alleen met goede map modus• 3D objecten – voeg simpelweg een Altitude toe• Alleen bij MapIcons• 3D map materiaal nog beperkt beschikbaar,

niet in NL• Camera!

Lessons learned

Page 30: Mapping & Locations on Windows 10

Tile setsKoppel publiek* toegankelijke online kaarten

Page 31: Mapping & Locations on Windows 10

Tile sets• WMS• TMS

• Publiek toegankelijk ≠ legaal toegankelijk

Page 32: Mapping & Locations on Windows 10

Demo 5 – Tile setsDownload the world

Page 33: Mapping & Locations on Windows 10

Tile sets

• X,Y, Zoom -> image van 256x256• TMS

• Pre-rendered• Snel• Take it or leave it

• WMS• On the fly gemaakt• Kies zelf je lagen• Langzamer

De wereld verdeeld in vakjes

Page 34: Mapping & Locations on Windows 10

MapTileSource

HttpMapTileDataSource

LocalMapTileDataSource CustomMapTileDataSource

TilesourcesMicrosoft

Page 35: Mapping & Locations on Windows 10

TilesourcesLocalJoost

BaseHttpTileSource

OpenStreetMapSource GoogleMapSource WMSTileSource

ITileSource

Page 36: Mapping & Locations on Windows 10

WMS• Service Url• WMS versie• Image type• Layers (onderste eerst)• Epsg

• 3857 • 900913• 4326

• Reference system name• SRS• CRS

Page 37: Mapping & Locations on Windows 10

GetCapabilities

{baseurl}?request=getcapabilities&service=WMS

http://geodata.nationaalgeoregister.nl/nwbwegen/ows?service=WMS&request=getcapabilities

Resultaat – een flink XML bestand

Wat kunt u voor mij betekenen?

Page 38: Mapping & Locations on Windows 10

Version

Page 39: Mapping & Locations on Windows 10

Image type

Page 40: Mapping & Locations on Windows 10

EPSG, Reference system & layers

Page 41: Mapping & Locations on Windows 10

WmsTileSource

new WmsTileSource( "RWS NWB", "http://geodata.nationaalgeoregister.nl/nwbwegen/ows?service=WMS", new[] { "wegvakken", "hectopunten" }, "1.3.0", "CRS", 3857, "image/png"));

Page 42: Mapping & Locations on Windows 10

‘Food for thought’

• Tiles downloaden naar device• Dan LocalMapTileDataSource gebruiken• Wees lief voor map providers• Kan illegaal zijn

Page 43: Mapping & Locations on Windows 10

Resumerend• T.o.v. Windows 8.1 – vrijwel alles gewijzigd behalve

geofencing en GPS • API = Windows Phone 8.1++ (min of meer)• Bye bye Bing Maps control

• T.o.v. Windows Phone 8.1 • MapIcons bruikbaar• 3D support*• Background location tracking (yay!)• Div kleine API uitbreidingen en wijzingen, m.n.

rondom Geolocation• Streetside maps*• Global offline maps

• TMS/WMS om meer kaarten te laten zien

Page 44: Mapping & Locations on Windows 10
Page 45: Mapping & Locations on Windows 10

http://dotnetbyexample.blogspot.com

@localjoost ( high volume!)

[email protected]

localjoostnl

Page 46: Mapping & Locations on Windows 10

Your feedback is important!Scan the QR Code and let us know via the TechDays App.

Laat ons weten wat u van de sessie vindt via de TechDays App!Scan de QR Code.

Bent u al lid van de Microsoft Virtual Academy?! Op MVA kunt u altijd iets nieuws leren over de laatste technologie van Microsoft. Meld u vandaag aan op de MVA Stand. MVA biedt 7/24 gratis online training on-demand voor IT-Professionals en Ontwikkelaars.