Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map...

32
Make your iOS Apps come alive with Map Animations Nicholas Furness

Transcript of Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map...

Page 1: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer

Make your iOS Apps come alive with

Map AnimationsNicholas Furness

Page 2: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer

Agenda

• Point animation

• Polyline animation

• Viewpoint animation

Page 3: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer

Point Animation

Page 4: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer

Animate along a

pathDemo

Page 5: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer

Animate along path

Frame 1

Frame 100

Frame 200

Frame 300

Frame 400

BA

Page 6: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer

Animate along path

AnimateAlongPathHelper Class

- polyline: AGSPolyline

- animatingGraphic: AGSGraphic

- speed: Double

+ startAnimation()

+ stopAnimation()

AnimateAlongPathHelperDelegate

- animateAlongPathHelperDidFinish()

Page 7: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer
Page 8: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer
Page 9: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer
Page 10: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer
Page 11: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer

Animation Manager

AnimationManager

+ animate(<animation closure>)

+ pause()

+ resume()

• Singleton

• Internal Timer

• Array of closures

- Each closure updates an

animated graphic

• 60 times a second

Page 12: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer

ApplicationsDemo

Page 13: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer

Draw polyline

animationDemo

Page 14: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer

Polyline animation

Page 15: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer

Remember animating along the path?

Frame 1

Frame 100

Frame 200

Frame 300

Frame 400

BA

Page 16: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer

Trace polyline animation

Frame 1

Frame 100

Frame 200

Frame 300

Frame 400

BA

Page 17: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer

Draw polyline animation

AnimateLineTraceHelper Class

- polyline: AGSPolyline

- animatingGraphic: AGSGraphic

- speed: Double

+ startAnimation()

+ stopAnimation()

Page 18: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer
Page 19: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer
Page 20: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer

ApplicationsDemo

Page 21: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer

Viewpoint Animation

Page 22: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer

Viewpoint

Animation Demo

Page 23: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer

Viewpoint animation

- initWithCenter(_: scale:)

- initWithCenter(_: scale: rotation:)

- initWithTargetExtent(_:)

- initWithTargetExtent(_: rotation:)

- initWithLatitude(_: longitude: scale:)

- setViewpoint(_: duration: completion:)

- setViewpoint(_: duration: curve: completion:)

AGSViewpoint AGSMapView

Page 24: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer

Viewpoint animation

- setViewpointCenter(_: completion:)

- setViewpointCenter(_: scale: completion:)

- setViewpointScale(_: completion:)

- setViewpointRotation(_: completion:)

- setViewpointGeometry(_: completion:)

- setViewpointGeometry(_: padding: completion:)

AGSMapView

Page 25: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer

Turn by turn

directionsDemo

Page 26: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer

Summary

• Moving a point along a line

• Tracing a line

• Animating the map’s viewpoint

Page 27: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer

Tips

• Performance

- Consider AGSGraphicsOverlay rendering mode .dynamic

- Use a renderer (instead of setting a symbol on each graphic)

- Be wary of too many Timers (AnimationManager keeps just one)

- Consider if you should Generalize complex geometries

- The AGSGeometryEngine is your friend

• UX

- Show direction to add context

- Don’t go 🍌🍌🍌. Too much animation can be a distraction

Page 28: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer

One more thing…

Page 29: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer

Scene Camera animation

Page 30: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer

Please Take Our Survey!

Download the Esri Events app

and find your event

Select the session you

attended

Scroll down to the

“Feedback” section

Complete Answers,

add a Comment,

and Select “Submit”

Page 31: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer

Demo project is posted on GitHub:

github.com/nixta/iOS-runtime-animations

Page 32: Make Your iOS Apps Come Alive with Map Animations · Make Your iOS Apps Come Alive with Map Animations, 2018 Esri Developer Summit Palm Spring -- Presentation, 2018 Esri Developer