Top Banner
Where am I?
47

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

Jan 22, 2018

Download

Technology

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introduction to Map and Location APIs (Silicon Valley Code Camp 2017)

Where amI?

Page 2: Introduction to Map and Location APIs (Silicon Valley Code Camp 2017)
Page 3: Introduction to Map and Location APIs (Silicon Valley Code Camp 2017)
Page 4: Introduction to Map and Location APIs (Silicon Valley Code Camp 2017)
Page 5: Introduction to Map and Location APIs (Silicon Valley Code Camp 2017)

We’re never really lostanymore.

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

LocationTechnology

Locationtechnology is anintegralpart of our daily lives.

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

LocationTechnology"80%of alldata is connected to location."

AbrahamLincoln

Page 8: Introduction to Map and Location APIs (Silicon Valley Code Camp 2017)
Page 9: Introduction to Map and Location APIs (Silicon Valley Code Camp 2017)
Page 10: Introduction to Map and Location APIs (Silicon Valley Code Camp 2017)

RichardSüselbeckDeveloperEvangelistHERETechnologies

@sueselbeck#svcc

SiliconValley

CODECAMP

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

Expectations

developer.here.com

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

Where amI?

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

Example:BrowserGeolocation API

navigator.geolocation.getCurrentPosition(function(position) {document.write(position.coords.latitude + ", " +

position.coords.longitude);});

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

Example:HEREAndroidPositioning API

PositioningManager positioningManager =PositioningManager.getInstance();

positioningManager.start(PositioningManager.LocationMethod.GPS_NETWORK);

GeoPosition position = positioningManager.GetPosition();

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

Sowe are at37.3723,-121.9222.Whatdoesthatmean?

Latitude&Longitude

Latitude Longitude

Equator

PrimeMeridian

+60

-30

-90(South)

+90(North) 180

-120(West)

+30(East)

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

How did weget thelocation?

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

How did weget thelocation?

GPS

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

How did weget thelocation?

GPS,GALILEO,GLONASS,BeiDou,NAVIC,QZSS

GNSS

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

How did weget thelocation?

GNSSisn‘t theonly way toget alocation.

Radiosignals:Celltowers,Wifi,Bluetooth,etc

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

Example:HEREPositioning 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"}

] }

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

Where amI?

Use aPositioning API.

Understand the technology the location comes from.Choose therightAPIfortherighttask/device.

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

WhereamI?By themselves alatitude and longitude aren‘t always helpful.

Their poweris inplacing us onamap.

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

MapsMakingMapsis hard.

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

MapsMakingMapsis hard.

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

Maps

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

Maps

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

Map APIs

Map ImageAPI InteractiveMap API

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

Example:HEREMap ImageAPI

https://image.maps.api.here.com/mia/1.6/mapview?&c=37.37774,-121.92186&z=16&w=640&h=400

centerofthemapzoomlevel

Imagewidthandheight

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

Example:HEREMap ImageAPI

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

linecolor

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

Example:HEREInteractiveMaps APIvar 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(newH.mapevents.MapEvents(map));

var ui = H.ui.UI.createDefault(map, defaultLayers);

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

WhereamI?2161N.FirstStSanJose,California95131

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

WhereamI?2161N.FirstStSanJose,California95131

Invalidenstraße 11610245Berlin

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

Geocoder API

37.37627,-121.9225692161N.FirstStSanJose,California95131

Invalidenstraße 11610245Berlin37.37627,-121.922569

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

https://reverse.geocoder.api.here.com/6.2/reversegeocode.json?&mode=retrieveAddresses&prox=52.5319841,13.3828921

Example:HEREGeocoder API

https://geocoder.api.here.com/6.2/geocode.json?&searchtext=2161+n+first+st+san+jose+california+95131

returnthecloseststreetaddresslocation(andradius)

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

What‘s around us?Maps provide context for alocation.

Places(points of interest)are another typeof context.

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

WheredoIwant togo?

Locationisn‘t justabout where youare.It‘s about where you‘re going.

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

Example:HEREPlacesAPI

// creates a Search entrypointvar search = new H.places.Search(platform.getPlacesService());// creates parameters for search requestvar params = {

'q': 'starbucks','at': '37.3720,-121.9221'

};// creates a request with callbackssearch.request(params, {}, onResult, onError);

function onResult(result) {}

function onError(error) {}

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

Example:HEREInteractiveMaps 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());

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

How doIget there?Findyour way using the RoutingAPI.

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

Example:HERERoutingAPI

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

startandendpoint

routingmode

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

What can Ireach?Isoline RoutingAPI

Which places can adelivery truck or taxi reach within 15minutes?

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

Example:HEREIsoline RoutingAPI

#07

var routingParams = { 'mode': 'fastest;car;', 'start': '37.80531,-122.4161', 'range': '900', 'rangetype': 'time'

};

var router = platform.getRoutingService();

router.calculateIsoline(routingParams,onResult,onError;});

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

Locationis solved!(sort of)

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

But:TheFutureis coming!

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

TheFuture™

10BillionPeople

GiantCities

Autonomous cars

Autonomous everything!

Everything is asensor! Newmobility concepts

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

HEREOpenLocationPlatform

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

@sueselbeck#svcc

Thank you!!

Abesays:“Signupondeveloper.here.com!”