Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Introduction to Map and Location APIs (Silicon Valley Code Camp 2017)

191 views

Published on

We've all gotten lost at some point in our lives. Finding out where we are, where we want to go, and how to get there is hard enough for people, but it’s even harder for our applications and devices. Fortunately, map and location APIs are here to help. From latitudes to longitudes, from geocoding to routing, in this session you'll learn to go beyond maps and help your apps and devices find their way using location technology.

Published in: Technology
  • Be the first to comment

Introduction to Map and Location APIs (Silicon Valley Code Camp 2017)

  1. 1. Where am I?
  2. 2. We’re never really lost anymore.
  3. 3. Location Technology Location technology is an integral part of our daily lives.
  4. 4. Location Technology "80% of all data is connected to location." Abraham Lincoln
  5. 5. Richard Süselbeck Developer Evangelist HERE Technologies @sueselbeck #svcc Silicon Valley CODE CAMP
  6. 6. Expectations developer.here.com
  7. 7. Where am I?
  8. 8. Example: Browser Geolocation API navigator.geolocation.getCurrentPosition(function(position) { document.write(position.coords.latitude + ", " + position.coords.longitude); });
  9. 9. Example: HERE Android Positioning API PositioningManager positioningManager = PositioningManager.getInstance(); positioningManager.start( PositioningManager.LocationMethod.GPS_NETWORK); GeoPosition position = positioningManager.GetPosition();
  10. 10. So we are at 37.3723, -121.9222. What does that mean? Latitude & Longitude Latitude Longitude Equator Prime Meridian +60 -30 -90 (South) +90 (North) 180 -120 (West) +30 (East)
  11. 11. How did we get the location?
  12. 12. How did we get the location? GPS
  13. 13. How did we get the location? GPS, GALILEO, GLONASS, BeiDou, NAVIC, QZSS GNSS
  14. 14. How did we get the location? GNSS isn‘t the only way to get a location. Radio signals: Cell towers, Wifi, Bluetooth, etc
  15. 15. Example: HERE Positioning API https://pos.api.here.com/positioning/v1/locate? app_id=YOUR_APP_ID &app_code=YOUR_APP_CODE credentials { "wlan": [ {"mac": "8C-1A-BF-20-66-AD"}, {"mac": "A0-E4-53-E9-66-A7"}, ... {"mac": "B8-6B-23-09-87-B1"}, {"mac": "F4-55-95-11-2C-C1"} ] }
  16. 16. Where am I? Use a Positioning API. Understand the technology the location comes from. Choose the right API for the right task/device.
  17. 17. Where am I? By themselves a latitude and longitude aren‘t always helpful. Their power is in placing us on a map.
  18. 18. Maps Making Maps is hard.
  19. 19. Maps Making Maps is hard.
  20. 20. Maps
  21. 21. Maps
  22. 22. Map APIs Map Image API Interactive Map API
  23. 23. Example: HERE Map Image API https://image.maps.api.here.com/mia/1.6/mapview? &c=37.37774, -121.92186 &z=16 &w=640 &h=400 center of the map zoom level Image width and height
  24. 24. Example: HERE Map Image API https://image.maps.api.here.com/mia/1.6/route? &r0=52.540867,13.262444, 52.536691,13.264561, 52.529172,13.268337, 52.528337,13.273144, 52.52583,13.27898, 52.518728,13.279667 &lc0=44ff00ff waypoints line color
  25. 25. Example: HERE Interactive Maps API var platform = new H.service.Platform({ app_id: ’1234567890', app_code: abcdefghi', useHTTPS: true }); var defaultLayers = platform.createDefaultLayers(); var map = new H.Map(document.getElementById('map'), defaultLayers.normal.map); var behavior = new H.mapevents.Behavior(new H.mapevents.MapEvents(map)); var ui = H.ui.UI.createDefault(map, defaultLayers);
  26. 26. Where am I? 2161 N. First St San Jose, California 95131
  27. 27. Where am I? 2161 N. First St San Jose, California 95131 Invalidenstraße 116 10245 Berlin
  28. 28. Geocoder API 37.37627, -121.922569 2161 N. First St San Jose, California 95131 Invalidenstraße 116 10245 Berlin37.37627, -121.922569
  29. 29. https://reverse.geocoder.api.here.com/6.2/reversegeocode.json? &mode=retrieveAddresses &prox=52.5319841,13.3828921 Example: HERE Geocoder API https://geocoder.api.here.com/6.2/geocode.json? &searchtext=2161+n+first+st+san+jose+california+95131 return the closest street address location (and radius)
  30. 30. What‘s around us? Maps provide context for a location. Places (points of interest) are another type of context.
  31. 31. Where do I want to go? Location isn‘t just about where you are. It‘s about where you‘re going.
  32. 32. Example: HERE Places API // creates a Search entrypoint var search = new H.places.Search(platform.getPlacesService()); // creates parameters for search request var params = { 'q': 'starbucks', 'at': '37.3720,-121.9221' }; // creates a request with callbacks search.request(params, {}, onResult, onError); function onResult(result) {} function onError(error) {}
  33. 33. Example: HERE Interactive Maps API var group = new H.map.Group(); group.addObjects(places.map(function (place) { var marker = new H.map.Marker({lat: place.position[0], lng: place.position[1]}) return marker; })); map.addObject(group); map.setViewBounds(group.getBounds());
  34. 34. How do I get there? Find your way using the Routing API.
  35. 35. Example: HERE Routing API https://route.api.here.com/routing/7.2/calculateroute.json? waypoint0=37.377,-121.921 &waypoint1=37.615,122.393 &mode=fastest;car;traffic:enabled start and end point routing mode
  36. 36. What can I reach? Isoline Routing API Which places can a delivery truck or taxi reach within 15 minutes?
  37. 37. Example: HERE Isoline Routing API #07 var routingParams = { 'mode': 'fastest;car;', 'start': '37.80531,-122.4161', 'range': '900', 'rangetype': 'time' }; var router = platform.getRoutingService(); router.calculateIsoline( routingParams, onResult,onError; });
  38. 38. Location is solved! (sort of)
  39. 39. But: The Future is coming!
  40. 40. The Future™ 10 Billion People Giant Cities Autonomous cars Autonomous everything! Everything is a sensor! New mobility concepts
  41. 41. HERE Open Location Platform
  42. 42. @sueselbeck #svcc Thank you!! Abe says: “Sign up on developer.here.com!”

×