Presentation is loading. Please wait.

Presentation is loading. Please wait.

Touchdevelop api api: location & maps show geo locations Disclaimer: This document is provided “as-is”. Information and views expressed in this document,

Similar presentations


Presentation on theme: "Touchdevelop api api: location & maps show geo locations Disclaimer: This document is provided “as-is”. Information and views expressed in this document,"— Presentation transcript:

1 touchdevelop api api: location & maps show geo locations Disclaimer: This document is provided “as-is”. Information and views expressed in this document, including URL and other Internet Web site references, may change without notice. You bear the risk of using it. This document does not provide you with any legal rights to any intellectual property in any Microsoft product. You may copy and use this document for your internal, reference purposes. © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and Windows Live are trademarks of the Microsoft group of companies. All other trademarks are property of their respective owners.

2 touchdevelop api location o many location sources Wi-Fi cellular radio GPS (high accuracy, high power consumption) o plan for unavailability of location data

3 touchdevelop api maps o many map providers we use Bing maps o many provided services show location annotate maps (pictures, lines, …) compute directions

4 touchdevelop api apis o Senses→current location Gets the current phone location. Senses→current location o Senses→current location accurate Gets the current phone location with the most accuracy. This includes using services that might charge money, or consuming higher levels of battery power or connection bandwidth. Senses→current location accurate o Locations→create location Creates a new geo coordinate location Locations→create location o Locations→search location Looks for the coordinate of an address using Bing. Locations→search location o Picture→location Gets the location where the picture was taken; if any. Picture→location o Link→location Gets the location if any Link→location o Place→location Gets the location of the place Place→location o Appointment→location Gets the location Appointment→location o Message→location Gets the geo coordinates Message→location o String→to location Parses the string as a geo coordinate. returns 'unknown' if parsing fails. String→to location

5 touchdevelop api apis o Senses→current location Gets the current phone location. Senses→current location o Senses→current location accurate Gets the current phone location with the most accuracy. This includes using services that might charge money, or consuming higher levels of battery power or connection bandwidth. Senses→current location accurate o Locations→create location Creates a new geo coordinate location Locations→create location o Locations→search location Looks for the coordinate of an address using Bing. Locations→search location o Picture→location Gets the location where the picture was taken; if any. Picture→location o Link→location Gets the location if any Link→location o Place→location Gets the location of the place Place→location o Appointment→location Gets the location Appointment→location o Message→location Gets the geo coordinates Message→location o String→to location Parses the string as a geo coordinate. returns 'unknown' if parsing fails. String→to location

6 touchdevelop api apis o Location→latitude Gets the latitude of the coordinate Location→latitude o Location→longitude Gets the longitude of the coordinate Location→longitude o Location→distance Calculates the distance in meters Location→distance o Location→speed Gets the speed of the coordinate Location→speed o Location→share Shares the location ( , sms, facebook, social or “” to pick from a list) Location→share o Location→altitude Gets the altitude of the coordinate Location→altitude o Location→hor accuracy Gets the horizontal accuracy of the coordinate Location→hor accuracy o Location→vert accuracy Gets the vertical accuracy of the coordinate Location→vert accuracy o Location→course Gets the course of the coordinate Location→course o Location→to string Converts to a string lat,long Location→to string o Location→post to wall Displays the location in a map using Bing. Location→post to wall o Locations→describe location Looks for an address near a location using Bing. Locations→describe location

7 touchdevelop api apis o Maps→create map Creates a Bing map. Use 'post to wall' to display it. Maps→create map o Maps→directions Calculates the directions between two coordinates using Bing. Maps→directions o Maps→open directions Shows the directions in the Bing map application. If search term is provided, location is ignored. Provide search term or location for start and end. Maps→open directions o Maps→open map Opens the Bing map application. zoom between 0 (close) and 1 (far). Maps→open map o Maps→create full map Creates a full screen Bing map. Use 'post to wall' to display it. Maps→create full map

8 touchdevelop api apis o Map→add text Adds a text pushpin on the map Map→add text o Map→add line Adds a polyline that passes through various geocoordinates Map→add line o Map→add picture Adds a picture pushpin on the map Map→add picture o Map→add place Adds a place pushpin on the map (ignored if the location is not set) Map→add place o Map→add link Adds a link pushpin on the map (ignored if the location if not set) Map→add link o Map→add message Adds a message pushpin on the map (ignored if the location is not set) Map→add message o Map→set center Sets the map center location Map→set center o Map→set zoom Sets the zoom level from 1 to 21 Map→set zoom o Map→center Gets the map center location Map→center o Map→clear Clears the lines, regions and pushpins Map→clear o Map→view pushpins Changes the current zoom and center so that all the pushpins are visible. Map→view pushpins o Map→zoom Gets the zoom level Map→zoom o Map→fill region Fills a region with a color Map→fill region o Map→post to wall Displays the map in the wall using Bing. Map→post to wall

9 touchdevelop api examples o go to picture ☁ o location and maps ☁ o park and find ☁

10 touchdevelop api exercises ►write a script with three executable actions: init: sets a global variable to an empty location collection record: adds current location to collection (can be called multiple times) show: show map where all a line connects all recorded locations

11 touchdevelop api homework ►finish exercise if not yet finished


Download ppt "Touchdevelop api api: location & maps show geo locations Disclaimer: This document is provided “as-is”. Information and views expressed in this document,"

Similar presentations


Ads by Google