SlideShare a Scribd company logo
1 of 36
Making Maps with FlashThe Google Maps API for Flash Ossama Alami, Google @ossamaalami#adobemax385
Agenda Introduction to the Google Maps API for Flash Creating a Map 3D Maps Recoloring Maps Demos Resources Q&A
Google Geospatial APIs
The Google Maps API for Flash ActionScript framework for developing mapping applications Supports development using the Flex SDK, FlexBuilder, or Flash CS3 Applications can run in a browser or standalone using AIR Class structure modeled on the JavaScript API Supports animated overlays, larger data sets, and 3D perspective
What’s Included Road, Terrain, Satellite, Hybrid Map Types Forward and reverse Geocoding Polylines and Polygons Markers and InfoWindows Driving and walking directions 3D perspective Support for ground overlays, custom overlays and controls Some features in the JavaScript Maps API are not currently natively supported:  Street View KML rendering Traffic  washingtonpost.com
Building and Running a Map Interface SWC
Running a Map
          Creating a Map
Basic Map ActionScript packagecom.google.maps.examples { importflash.events.Event; importcom.google.maps.Map; importcom.google.maps.MapEvent; importcom.google.maps.MapType; importcom.google.maps.LatLng; publicclassMapsHelloextends Map { publicfunctionMapsHello() { super(); addEventListener(MapEvent.MAP_READY, onMapReady);   } privatefunctiononMapReady(event:MapEvent):void { setCenter(new LatLng(34.040605, -118.268133), 16, MapType.NORMAL_MAP_TYPE);    } } } MXML <examples:MapsHelloxmlns:examples="com.google.maps.examples.*” key="ABCDEF" width="800" height="600"/>
Our Map So Far Center@34.040605, -118.268133 Zoom Level 16 Road Map
Customizing The Map Behavior Dragging Continous Zoom Scroll Wheel Support Double Click Behavior Crosshairs Keyboard Controls Controls PositionControl ZoomControl MapTypeControl ScaleControl OverviewMapControl NavigationControl Custom Controls addControl(newMapTypeControl()); addControl(newOverviewMapControl()); addControl(newNavigationControl()); enableScrollWheelZoom(); enableContinuousZoom();
Our Map So Far MapTypeControl NavigationControl Center@34.040605, -118.268133 Zoom Level 16 Road Map OverviewMapControl
Markers, Events and Info Windows Adding a Marker varlatLng:LatLng = new LatLng(34.040605, -118.268133); varmarker:Marker = newMarker(latLng,  newMarkerOptions({tooltip:"Adobe MAX 2009"})); addOverlay(marker); Opening an Info Window on a Marker Click Event marker.addEventListener(MapMouseEvent.CLICK, function(e:MapMouseEvent):void { marker.openInfoWindow(newInfoWindowOptions(             {title:"Los Angeles Convention Center”,       content:marker.getLatLng().toString()}));       });
Marker Options FillStyle alpha:[Number] color:[Number] gradient:GradientStyle DisplayObject Matrix GradientStyle Point alphas:Array[Number] colors:Array[Number] focalPointRatio:[Number] interpolationMethod:String matrix:Matrix ratios:Array[Number] spreadMethod:String type:String MarkerOptions TextFormat draggable:[Boolean] false fillStyle:FillStyle {color:0xFF766A, alpha:1} gravity:[Number] 0.8 hasShadow:[Boolean] true icon:DisplayObject null iconAlignment:[Number] null iconOffset:Point null label:String null labelFormat:TextFormat {font:"_sans", size:12, color:Color.BLACK} radius:[Number] 9 strokeStyle:StrokeStyle {thickness:2, alpha:1, color:Color.BLACK} tooltip:String null StrokeStyle alpha:[Number] color:[Number] thickness:[Number]
Our Map So Far MapTypeControl NavigationControl InfoWindow Marker with Tooltip Center@34.040605, -118.268133 Zoom Level 16 Road Map OverviewMapControl
Custom Markers and InfoWindows Markers and Info Windows can be created with any arbitrary DisplayObject, including images and Flash movies.
Maps API for Flash: Services Geocoding – Pass in an address and get a LatLng Reverse Geocoding – Pass in a LatLng and get and address Driving & Walking Directions vargeocoder:ClientGeocoder = newClientGeocoder(); geocoder.addEventListener(GeocodingEvent.GEOCODING_SUCCESS,  function(e:GeocodingEvent):void { varplacemarks:Array = e.response.placemarks; if(placemarks.length > 0) { addOverlay(new Marker(placemarks[0].point, newMarkerOptions({tooltip:"Google SF"})));     } }); geocoder.geocode("345 Spear St., San Francisco, CA");  vardir:Directions = new Directions(); dir.addEventListener(DirectionsEvent.DIRECTIONS_SUCCESS, function(event:DirectionsEvent):void { varpolyline:IPolyline = dir.createPolyline(); addOverlay(polyline); }); dir.load("345 spear st, sf to 1201 S Figueroa St, la");
          3D Perspective
Giving a Map Perspective To add 3D capabilities to your map, you simply need to make the following changes to your code: Import the com.google.maps.Map3D, com.google.maps.View, and com.google.maps.geom.Attitude classes. Instead of extending a Map object, extend a Map3D object. Within the map's MAP_PREINITIALIZE event, set the map's view to VIEWMODE_PERSPECTIVE Optionally, you can also set aninitial attitude for the map to display at an oblique angle. We recommend 3D mapsapps build for Flash 10
Giving Our Map a little Perspective package examples { importcom.google.maps.LatLng; import com.google.maps.Map3D; importcom.google.maps.MapEvent; importcom.google.maps.MapOptions; importcom.google.maps.MapType; importcom.google.maps.View; importcom.google.maps.geom.Attitude; publicclass MapsHello3d extends Map3D { publicfunction MapsHello3d() { super(); addEventListener(MapEvent.MAP_PREINITIALIZE, onMapPreinitialize);          } privatefunctiononMapPreinitialize(event:MapEvent):void { varmyMapOptions:MapOptions = newMapOptions(); myMapOptions.zoom = 16; myMapOptions.center = new LatLng(34.040605, -118.268133) myMapOptions.mapType = MapType.NORMAL_MAP_TYPE; myMapOptions.viewMode = View.VIEWMODE_PERSPECTIVE; myMapOptions.attitude = new Attitude(20,30,0); setInitOptions(myMapOptions);   } } }
The attitude is a value which defines the angles of incidence for the map, as seen from the viewer's perspective (the "camera"). These angles of incidence are three values: yaw defines the "direction" of the camera with respect to north.  pitch defines the angle of incidence of the camera with respect to the map's horizon. roll defines the angle of incidenceof the camera with respect to its "footing.” Map Attitude
Map View Mode The Map3D object contains a view property which indicates what sort of view the 3D map should exhibit.  VIEWMODE_2D displays a standard 2D map. VIEWMODE_PERSPECTIVE displays a 3D map with perspective VIEWMODE_ORTHOGONAL displays a 3D map with no perspective
Map View Mode   VIEWMODE_PERSPECTIVE  		   VIEWMODE_ORTHOGONAL
Our Map So Far Marker in San Francisco Driving Directions Polyline InfoWindow and Shadow NavigationControl Marker in LA Custom Control Displaying Attitude
3D Map Features NavigationControl will automatically contain attitude controls. Keyboard attitude controls are the same as Google Earth’s. Map3D contains a flyTo() method for animating location changes. ICamera provides a getTranslationGeometry() method for converting between latitude/longitude and pixel coordinates, useful for placing three-dimensional objects on the map.
3d Perspective: Samples Driving Tour Demo Away We Go Movie Site GeoQuake Driving Simulator UK Weather Tour Papervision3d Scene Overlay Eiffel Tower Example Streetview 3d Perspective Sync Situlational Awareness Demo
Recoloring The Map
Recoloring Maps We now allow recoloring of Map tiles when using the Maps API for Flash through Flash’s graphics filters Flash’s graphics filters let you add effects to any DisplayObject We do require that you request formal permission from Google before you do this. https://spreadsheets.google.com/viewform?formkey=cm0zMDkzOHZWMjJneEl2RVdkNFZRb0E6MA nytimes.com
Recoloring Maps: Code varR:Number = 0.299;   varG:Number = 0.587;  varB:Number = 0.114; varmatrix:Array = [ //R  G  B  A  O   - Red, Green, Blue, Alpha, Offset    R, G, B, 0, 0,  // Red Result    R, G, B, 0, 0,  // Green Result    R, G, B, 0, 0,  // Blue Result    0, 0, 0, 1, 0]; // Alpha Result varCMF:ColorMatrixFilter = newColorMatrixFilter(matrix); varmapPart:Sprite = Sprite(map).getChildAt(1) as Sprite; varmapArea:Sprite = mapPart.getChildAt(0) as Sprite; mapArea.filters = [CMF]
Recoloring Maps: Samples Sample Recoloring Map New York Times Homicides Map Sample Routeplanner Tokyo Fasion Map
          Sample Sites
More Sample Sites WDT iMapWeather 360 Cities Tufts University Boston Campus Maps Coka-Cola Xmas Charles Schwab Ad Mannahatta Washington Post – TimeSpace
          Resources
Docs & More: Google Code http://code.google.com/apis/maps/documentation/flash/ Sign up for a Google Maps API Key Free vs Premier Maps Download the SDK Developers Guide and tutorials for Flex, FlexBuilder, Flash CS3 Change log, Known Issues and Feature requests API Reference Demos, Examples, Articles User Forum Geo Developers Blog ... and more
Open Source Libraries http://gmaps-utility-library-flash.googlecode.com
          Q&A Thanks! @ossamaalami #adobemax385

More Related Content

Viewers also liked

ArcGIS JavaScript API (build a web layer-based map application with html5 and...
ArcGIS JavaScript API (build a web layer-based map application with html5 and...ArcGIS JavaScript API (build a web layer-based map application with html5 and...
ArcGIS JavaScript API (build a web layer-based map application with html5 and...Stefano Marchisio
 
Smart taxi system
Smart taxi systemSmart taxi system
Smart taxi systemPilar Media
 
Mobile Data Terminal M710W Presentation
Mobile Data Terminal M710W PresentationMobile Data Terminal M710W Presentation
Mobile Data Terminal M710W PresentationHarvey Wang
 
What's that Building? Using Google's Map API to Create a Campus Map
What's that Building?  Using Google's Map API to Create a Campus MapWhat's that Building?  Using Google's Map API to Create a Campus Map
What's that Building? Using Google's Map API to Create a Campus MapTony Miller
 
Ola business model
Ola business modelOla business model
Ola business modelAnil Bharti
 
Presentation of Trusystem Technologies
Presentation of Trusystem Technologies Presentation of Trusystem Technologies
Presentation of Trusystem Technologies Trusystem Technologies
 
Taxi app webinar
Taxi app webinarTaxi app webinar
Taxi app webinarAyush Jain
 
API Technical Writing
API Technical WritingAPI Technical Writing
API Technical WritingSarah Maddox
 
17 Copywriting Do's and Don'ts: How To Write Persuasive Content
17 Copywriting Do's and Don'ts: How To Write Persuasive Content17 Copywriting Do's and Don'ts: How To Write Persuasive Content
17 Copywriting Do's and Don'ts: How To Write Persuasive ContentHenneke Duistermaat
 
Social Proof Tips to Boost Landing Page Conversions
Social Proof Tips to Boost Landing Page ConversionsSocial Proof Tips to Boost Landing Page Conversions
Social Proof Tips to Boost Landing Page ConversionsAngie Schottmuller
 
The Science of Email Marketing
The Science of Email MarketingThe Science of Email Marketing
The Science of Email MarketingHubSpot
 
Europas BlaBlaCar pitch
Europas BlaBlaCar pitchEuropas BlaBlaCar pitch
Europas BlaBlaCar pitchVanina Schick
 
Email Marketing 101: The Welcome Email
Email Marketing 101: The Welcome EmailEmail Marketing 101: The Welcome Email
Email Marketing 101: The Welcome EmailSendGrid
 
26 Top Crowdfunding Sites (Infographic)
26 Top Crowdfunding Sites (Infographic)26 Top Crowdfunding Sites (Infographic)
26 Top Crowdfunding Sites (Infographic)Wrike
 
Quick & Dirty Tips for : Better PowerPoint Presentations Faster
Quick & Dirty Tips for : Better PowerPoint Presentations FasterQuick & Dirty Tips for : Better PowerPoint Presentations Faster
Quick & Dirty Tips for : Better PowerPoint Presentations FasterEugene Cheng
 
How To Assemble a High Converting eBook
How To Assemble a High Converting eBookHow To Assemble a High Converting eBook
How To Assemble a High Converting eBookUberflip
 
The Sharing Economy
The Sharing EconomyThe Sharing Economy
The Sharing EconomyLoic Le Meur
 

Viewers also liked (20)

ArcGIS JavaScript API (build a web layer-based map application with html5 and...
ArcGIS JavaScript API (build a web layer-based map application with html5 and...ArcGIS JavaScript API (build a web layer-based map application with html5 and...
ArcGIS JavaScript API (build a web layer-based map application with html5 and...
 
Google Map API
Google Map APIGoogle Map API
Google Map API
 
Smart taxi system
Smart taxi systemSmart taxi system
Smart taxi system
 
Mobile Data Terminal M710W Presentation
Mobile Data Terminal M710W PresentationMobile Data Terminal M710W Presentation
Mobile Data Terminal M710W Presentation
 
What's that Building? Using Google's Map API to Create a Campus Map
What's that Building?  Using Google's Map API to Create a Campus MapWhat's that Building?  Using Google's Map API to Create a Campus Map
What's that Building? Using Google's Map API to Create a Campus Map
 
Ola business model
Ola business modelOla business model
Ola business model
 
Presentation of Trusystem Technologies
Presentation of Trusystem Technologies Presentation of Trusystem Technologies
Presentation of Trusystem Technologies
 
Taxi app webinar
Taxi app webinarTaxi app webinar
Taxi app webinar
 
API Technical Writing
API Technical WritingAPI Technical Writing
API Technical Writing
 
17 Copywriting Do's and Don'ts: How To Write Persuasive Content
17 Copywriting Do's and Don'ts: How To Write Persuasive Content17 Copywriting Do's and Don'ts: How To Write Persuasive Content
17 Copywriting Do's and Don'ts: How To Write Persuasive Content
 
Social Proof Tips to Boost Landing Page Conversions
Social Proof Tips to Boost Landing Page ConversionsSocial Proof Tips to Boost Landing Page Conversions
Social Proof Tips to Boost Landing Page Conversions
 
The Science of Email Marketing
The Science of Email MarketingThe Science of Email Marketing
The Science of Email Marketing
 
Europas BlaBlaCar pitch
Europas BlaBlaCar pitchEuropas BlaBlaCar pitch
Europas BlaBlaCar pitch
 
The Ultimate Freebies Guide for Presentations by @damonify
The Ultimate Freebies Guide for Presentations by @damonifyThe Ultimate Freebies Guide for Presentations by @damonify
The Ultimate Freebies Guide for Presentations by @damonify
 
Brand New World
Brand New WorldBrand New World
Brand New World
 
Email Marketing 101: The Welcome Email
Email Marketing 101: The Welcome EmailEmail Marketing 101: The Welcome Email
Email Marketing 101: The Welcome Email
 
26 Top Crowdfunding Sites (Infographic)
26 Top Crowdfunding Sites (Infographic)26 Top Crowdfunding Sites (Infographic)
26 Top Crowdfunding Sites (Infographic)
 
Quick & Dirty Tips for : Better PowerPoint Presentations Faster
Quick & Dirty Tips for : Better PowerPoint Presentations FasterQuick & Dirty Tips for : Better PowerPoint Presentations Faster
Quick & Dirty Tips for : Better PowerPoint Presentations Faster
 
How To Assemble a High Converting eBook
How To Assemble a High Converting eBookHow To Assemble a High Converting eBook
How To Assemble a High Converting eBook
 
The Sharing Economy
The Sharing EconomyThe Sharing Economy
The Sharing Economy
 

Similar to Adobe MAX 2009: Making Maps with Flash

Google Maps API - DevFest Karlsruhe
Google Maps API - DevFest Karlsruhe Google Maps API - DevFest Karlsruhe
Google Maps API - DevFest Karlsruhe Martin Kleppe
 
How data rules the world: Telemetry in Battlefield Heroes
How data rules the world: Telemetry in Battlefield HeroesHow data rules the world: Telemetry in Battlefield Heroes
How data rules the world: Telemetry in Battlefield HeroesElectronic Arts / DICE
 
Google Chart Tools Kanika Garg (10BM60035) Lavanya R. (10BM60042)
Google Chart Tools Kanika Garg (10BM60035) Lavanya R. (10BM60042)Google Chart Tools Kanika Garg (10BM60035) Lavanya R. (10BM60042)
Google Chart Tools Kanika Garg (10BM60035) Lavanya R. (10BM60042)Kanika Garg
 
Introduction to open_gl_in_android
Introduction to open_gl_in_androidIntroduction to open_gl_in_android
Introduction to open_gl_in_androidtamillarasan
 
Google Chart Tools
Google Chart Tools Google Chart Tools
Google Chart Tools Kanika Garg
 
Android application for gps
Android application for gpsAndroid application for gps
Android application for gpsSutej Chakka
 
Ioannis Doxaras on GIS and Gmaps at 1st GTUG meetup Greece
Ioannis Doxaras on GIS and Gmaps at 1st GTUG meetup Greece Ioannis Doxaras on GIS and Gmaps at 1st GTUG meetup Greece
Ioannis Doxaras on GIS and Gmaps at 1st GTUG meetup Greece CoLab Athens
 
Seeing your place in a new way - NodeconfEU 2018
Seeing your place in a new way -  NodeconfEU 2018Seeing your place in a new way -  NodeconfEU 2018
Seeing your place in a new way - NodeconfEU 2018Melissa Auclaire
 
INAC Online Hazards Database App
INAC Online Hazards Database AppINAC Online Hazards Database App
INAC Online Hazards Database AppGerry James
 
Android mobile application for gps
Android mobile application for gpsAndroid mobile application for gps
Android mobile application for gpsSutej Chakka
 
Integration of Google-map in Rails Application
Integration of Google-map in Rails ApplicationIntegration of Google-map in Rails Application
Integration of Google-map in Rails ApplicationSwati Jadhav
 
Creating an Uber Clone - Part VII - Transcript.pdf
Creating an Uber Clone - Part VII - Transcript.pdfCreating an Uber Clone - Part VII - Transcript.pdf
Creating an Uber Clone - Part VII - Transcript.pdfShaiAlmog1
 
Hands on with the Google Maps Data API
Hands on with the Google Maps Data APIHands on with the Google Maps Data API
Hands on with the Google Maps Data APIss318
 
426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer Tools426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer ToolsMark Billinghurst
 
Creating an Uber Clone - Part IV - Transcript.pdf
Creating an Uber Clone - Part IV - Transcript.pdfCreating an Uber Clone - Part IV - Transcript.pdf
Creating an Uber Clone - Part IV - Transcript.pdfShaiAlmog1
 
ArcGIS API for Javascript Tutorial
ArcGIS API for Javascript TutorialArcGIS API for Javascript Tutorial
ArcGIS API for Javascript TutorialMohammed Mahmoud
 

Similar to Adobe MAX 2009: Making Maps with Flash (20)

Google Maps JS API
Google Maps JS APIGoogle Maps JS API
Google Maps JS API
 
Google Maps API - DevFest Karlsruhe
Google Maps API - DevFest Karlsruhe Google Maps API - DevFest Karlsruhe
Google Maps API - DevFest Karlsruhe
 
How data rules the world: Telemetry in Battlefield Heroes
How data rules the world: Telemetry in Battlefield HeroesHow data rules the world: Telemetry in Battlefield Heroes
How data rules the world: Telemetry in Battlefield Heroes
 
Geolocation and Mapping
Geolocation and MappingGeolocation and Mapping
Geolocation and Mapping
 
Google Chart Tools Kanika Garg (10BM60035) Lavanya R. (10BM60042)
Google Chart Tools Kanika Garg (10BM60035) Lavanya R. (10BM60042)Google Chart Tools Kanika Garg (10BM60035) Lavanya R. (10BM60042)
Google Chart Tools Kanika Garg (10BM60035) Lavanya R. (10BM60042)
 
Intro To Google Maps
Intro To Google MapsIntro To Google Maps
Intro To Google Maps
 
Introduction to open_gl_in_android
Introduction to open_gl_in_androidIntroduction to open_gl_in_android
Introduction to open_gl_in_android
 
Google Chart Tools
Google Chart Tools Google Chart Tools
Google Chart Tools
 
Android application for gps
Android application for gpsAndroid application for gps
Android application for gps
 
Ioannis Doxaras on GIS and Gmaps at 1st GTUG meetup Greece
Ioannis Doxaras on GIS and Gmaps at 1st GTUG meetup Greece Ioannis Doxaras on GIS and Gmaps at 1st GTUG meetup Greece
Ioannis Doxaras on GIS and Gmaps at 1st GTUG meetup Greece
 
Seeing your place in a new way - NodeconfEU 2018
Seeing your place in a new way -  NodeconfEU 2018Seeing your place in a new way -  NodeconfEU 2018
Seeing your place in a new way - NodeconfEU 2018
 
INAC Online Hazards Database App
INAC Online Hazards Database AppINAC Online Hazards Database App
INAC Online Hazards Database App
 
Android mobile application for gps
Android mobile application for gpsAndroid mobile application for gps
Android mobile application for gps
 
Integration of Google-map in Rails Application
Integration of Google-map in Rails ApplicationIntegration of Google-map in Rails Application
Integration of Google-map in Rails Application
 
Creating an Uber Clone - Part VII - Transcript.pdf
Creating an Uber Clone - Part VII - Transcript.pdfCreating an Uber Clone - Part VII - Transcript.pdf
Creating an Uber Clone - Part VII - Transcript.pdf
 
Hands on with the Google Maps Data API
Hands on with the Google Maps Data APIHands on with the Google Maps Data API
Hands on with the Google Maps Data API
 
Ex32018.pdf
Ex32018.pdfEx32018.pdf
Ex32018.pdf
 
426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer Tools426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer Tools
 
Creating an Uber Clone - Part IV - Transcript.pdf
Creating an Uber Clone - Part IV - Transcript.pdfCreating an Uber Clone - Part IV - Transcript.pdf
Creating an Uber Clone - Part IV - Transcript.pdf
 
ArcGIS API for Javascript Tutorial
ArcGIS API for Javascript TutorialArcGIS API for Javascript Tutorial
ArcGIS API for Javascript Tutorial
 

Recently uploaded

Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 

Recently uploaded (20)

Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 

Adobe MAX 2009: Making Maps with Flash

  • 1. Making Maps with FlashThe Google Maps API for Flash Ossama Alami, Google @ossamaalami#adobemax385
  • 2. Agenda Introduction to the Google Maps API for Flash Creating a Map 3D Maps Recoloring Maps Demos Resources Q&A
  • 4. The Google Maps API for Flash ActionScript framework for developing mapping applications Supports development using the Flex SDK, FlexBuilder, or Flash CS3 Applications can run in a browser or standalone using AIR Class structure modeled on the JavaScript API Supports animated overlays, larger data sets, and 3D perspective
  • 5. What’s Included Road, Terrain, Satellite, Hybrid Map Types Forward and reverse Geocoding Polylines and Polygons Markers and InfoWindows Driving and walking directions 3D perspective Support for ground overlays, custom overlays and controls Some features in the JavaScript Maps API are not currently natively supported:  Street View KML rendering Traffic  washingtonpost.com
  • 6. Building and Running a Map Interface SWC
  • 8. Creating a Map
  • 9. Basic Map ActionScript packagecom.google.maps.examples { importflash.events.Event; importcom.google.maps.Map; importcom.google.maps.MapEvent; importcom.google.maps.MapType; importcom.google.maps.LatLng; publicclassMapsHelloextends Map { publicfunctionMapsHello() { super(); addEventListener(MapEvent.MAP_READY, onMapReady); } privatefunctiononMapReady(event:MapEvent):void { setCenter(new LatLng(34.040605, -118.268133), 16, MapType.NORMAL_MAP_TYPE); } } } MXML <examples:MapsHelloxmlns:examples="com.google.maps.examples.*” key="ABCDEF" width="800" height="600"/>
  • 10. Our Map So Far Center@34.040605, -118.268133 Zoom Level 16 Road Map
  • 11. Customizing The Map Behavior Dragging Continous Zoom Scroll Wheel Support Double Click Behavior Crosshairs Keyboard Controls Controls PositionControl ZoomControl MapTypeControl ScaleControl OverviewMapControl NavigationControl Custom Controls addControl(newMapTypeControl()); addControl(newOverviewMapControl()); addControl(newNavigationControl()); enableScrollWheelZoom(); enableContinuousZoom();
  • 12. Our Map So Far MapTypeControl NavigationControl Center@34.040605, -118.268133 Zoom Level 16 Road Map OverviewMapControl
  • 13. Markers, Events and Info Windows Adding a Marker varlatLng:LatLng = new LatLng(34.040605, -118.268133); varmarker:Marker = newMarker(latLng, newMarkerOptions({tooltip:"Adobe MAX 2009"})); addOverlay(marker); Opening an Info Window on a Marker Click Event marker.addEventListener(MapMouseEvent.CLICK, function(e:MapMouseEvent):void { marker.openInfoWindow(newInfoWindowOptions( {title:"Los Angeles Convention Center”, content:marker.getLatLng().toString()})); });
  • 14. Marker Options FillStyle alpha:[Number] color:[Number] gradient:GradientStyle DisplayObject Matrix GradientStyle Point alphas:Array[Number] colors:Array[Number] focalPointRatio:[Number] interpolationMethod:String matrix:Matrix ratios:Array[Number] spreadMethod:String type:String MarkerOptions TextFormat draggable:[Boolean] false fillStyle:FillStyle {color:0xFF766A, alpha:1} gravity:[Number] 0.8 hasShadow:[Boolean] true icon:DisplayObject null iconAlignment:[Number] null iconOffset:Point null label:String null labelFormat:TextFormat {font:"_sans", size:12, color:Color.BLACK} radius:[Number] 9 strokeStyle:StrokeStyle {thickness:2, alpha:1, color:Color.BLACK} tooltip:String null StrokeStyle alpha:[Number] color:[Number] thickness:[Number]
  • 15. Our Map So Far MapTypeControl NavigationControl InfoWindow Marker with Tooltip Center@34.040605, -118.268133 Zoom Level 16 Road Map OverviewMapControl
  • 16. Custom Markers and InfoWindows Markers and Info Windows can be created with any arbitrary DisplayObject, including images and Flash movies.
  • 17. Maps API for Flash: Services Geocoding – Pass in an address and get a LatLng Reverse Geocoding – Pass in a LatLng and get and address Driving & Walking Directions vargeocoder:ClientGeocoder = newClientGeocoder(); geocoder.addEventListener(GeocodingEvent.GEOCODING_SUCCESS, function(e:GeocodingEvent):void { varplacemarks:Array = e.response.placemarks; if(placemarks.length > 0) { addOverlay(new Marker(placemarks[0].point, newMarkerOptions({tooltip:"Google SF"}))); } }); geocoder.geocode("345 Spear St., San Francisco, CA"); vardir:Directions = new Directions(); dir.addEventListener(DirectionsEvent.DIRECTIONS_SUCCESS, function(event:DirectionsEvent):void { varpolyline:IPolyline = dir.createPolyline(); addOverlay(polyline); }); dir.load("345 spear st, sf to 1201 S Figueroa St, la");
  • 18. 3D Perspective
  • 19. Giving a Map Perspective To add 3D capabilities to your map, you simply need to make the following changes to your code: Import the com.google.maps.Map3D, com.google.maps.View, and com.google.maps.geom.Attitude classes. Instead of extending a Map object, extend a Map3D object. Within the map's MAP_PREINITIALIZE event, set the map's view to VIEWMODE_PERSPECTIVE Optionally, you can also set aninitial attitude for the map to display at an oblique angle. We recommend 3D mapsapps build for Flash 10
  • 20. Giving Our Map a little Perspective package examples { importcom.google.maps.LatLng; import com.google.maps.Map3D; importcom.google.maps.MapEvent; importcom.google.maps.MapOptions; importcom.google.maps.MapType; importcom.google.maps.View; importcom.google.maps.geom.Attitude; publicclass MapsHello3d extends Map3D { publicfunction MapsHello3d() { super(); addEventListener(MapEvent.MAP_PREINITIALIZE, onMapPreinitialize); } privatefunctiononMapPreinitialize(event:MapEvent):void { varmyMapOptions:MapOptions = newMapOptions(); myMapOptions.zoom = 16; myMapOptions.center = new LatLng(34.040605, -118.268133) myMapOptions.mapType = MapType.NORMAL_MAP_TYPE; myMapOptions.viewMode = View.VIEWMODE_PERSPECTIVE; myMapOptions.attitude = new Attitude(20,30,0); setInitOptions(myMapOptions); } } }
  • 21. The attitude is a value which defines the angles of incidence for the map, as seen from the viewer's perspective (the "camera"). These angles of incidence are three values: yaw defines the "direction" of the camera with respect to north. pitch defines the angle of incidence of the camera with respect to the map's horizon. roll defines the angle of incidenceof the camera with respect to its "footing.” Map Attitude
  • 22. Map View Mode The Map3D object contains a view property which indicates what sort of view the 3D map should exhibit. VIEWMODE_2D displays a standard 2D map. VIEWMODE_PERSPECTIVE displays a 3D map with perspective VIEWMODE_ORTHOGONAL displays a 3D map with no perspective
  • 23. Map View Mode VIEWMODE_PERSPECTIVE VIEWMODE_ORTHOGONAL
  • 24. Our Map So Far Marker in San Francisco Driving Directions Polyline InfoWindow and Shadow NavigationControl Marker in LA Custom Control Displaying Attitude
  • 25. 3D Map Features NavigationControl will automatically contain attitude controls. Keyboard attitude controls are the same as Google Earth’s. Map3D contains a flyTo() method for animating location changes. ICamera provides a getTranslationGeometry() method for converting between latitude/longitude and pixel coordinates, useful for placing three-dimensional objects on the map.
  • 26. 3d Perspective: Samples Driving Tour Demo Away We Go Movie Site GeoQuake Driving Simulator UK Weather Tour Papervision3d Scene Overlay Eiffel Tower Example Streetview 3d Perspective Sync Situlational Awareness Demo
  • 28. Recoloring Maps We now allow recoloring of Map tiles when using the Maps API for Flash through Flash’s graphics filters Flash’s graphics filters let you add effects to any DisplayObject We do require that you request formal permission from Google before you do this. https://spreadsheets.google.com/viewform?formkey=cm0zMDkzOHZWMjJneEl2RVdkNFZRb0E6MA nytimes.com
  • 29. Recoloring Maps: Code varR:Number = 0.299; varG:Number = 0.587; varB:Number = 0.114; varmatrix:Array = [ //R G B A O - Red, Green, Blue, Alpha, Offset R, G, B, 0, 0, // Red Result R, G, B, 0, 0, // Green Result R, G, B, 0, 0, // Blue Result 0, 0, 0, 1, 0]; // Alpha Result varCMF:ColorMatrixFilter = newColorMatrixFilter(matrix); varmapPart:Sprite = Sprite(map).getChildAt(1) as Sprite; varmapArea:Sprite = mapPart.getChildAt(0) as Sprite; mapArea.filters = [CMF]
  • 30. Recoloring Maps: Samples Sample Recoloring Map New York Times Homicides Map Sample Routeplanner Tokyo Fasion Map
  • 31. Sample Sites
  • 32. More Sample Sites WDT iMapWeather 360 Cities Tufts University Boston Campus Maps Coka-Cola Xmas Charles Schwab Ad Mannahatta Washington Post – TimeSpace
  • 33. Resources
  • 34. Docs & More: Google Code http://code.google.com/apis/maps/documentation/flash/ Sign up for a Google Maps API Key Free vs Premier Maps Download the SDK Developers Guide and tutorials for Flex, FlexBuilder, Flash CS3 Change log, Known Issues and Feature requests API Reference Demos, Examples, Articles User Forum Geo Developers Blog ... and more
  • 35. Open Source Libraries http://gmaps-utility-library-flash.googlecode.com
  • 36. Q&A Thanks! @ossamaalami #adobemax385

Editor's Notes

  1. Also:KML – an open standard for storing geospatial dataHTTP Geocoder API – and I’ll talk about geocoding a little laterMaplets API – witch lets you developer “maplets” or widgets that can be used in conjunction with My Maps on maps.google.comPanoramio API – which lets you access high quality geo-taged photographsSketchUp API- which lets you automate and SketchUp, our 3d modeling toolAJAX Local Search API – a really powerful API which lets you search for and retrieve POI and other geotagged data from all over the web
  2. Maps API KeyVery similar to the JavaScript API architectureDynamic loading of the implementation library, at runtime it will download the version of the implementation libraryBy default you’re going to get the latest version, but you do have the option of specifying a specific version
  3. Getting started.Set up our environment, you can use Flex, FlexBuilder or Flash. For these example I’m going to use FlexBudiler, but its just as easy to use the free flex complier to build these mapsSign up for a Maps API key at code.google.comDownload the SDK, we have two, one for flash cs3 and one for flex
  4. The Maps API for Flash comes with a handful of built-in controls you can use in your maps:PositionControl - a pan control as used on Google Maps. Appears in the top left corner of the map by default.ZoomControl - a zoom control slider as used on Google Maps.MapTypeControl - buttons that let the user toggle between map types (such as Map and Satellite).ScaleControl - a scale control is a visual indicator used to indicate the resolution of the current map and zoom level.OverviewMapControl - a collapsible overview map in the corner of the screen.All of these controls implement the IControl interface. You can also build your own custom controls by subclassing the ControlBase class (which provides implementations not provided in the interface).
  5. Markers and Info Windows can be created with any arbitrary DisplayObject, including Flash movies.
  6. Markers and Info Windows can be created with any arbitrary DisplayObject, including Flash movies.
  7. In each case, the event returns information related to the geocoding request in the following properties of the GeocodingEvent itself:request stores the original geocoding request as a text string.requestType stores the type of geocoding request (currently "geocoding" is the only request type).response.placemarks.address stores the resolved address.response.placemarks.addressDetails stores address details conforming toxAL, or eXtensible Address Language, an international standard for address formating.response.placemarks.point stores the LatLng of the geocoded addressstatus contains the status of the geocding request and generally holds additional information for why a geocoding attempt has failed, for example.reverseGeocode methodDirectionsBy default, directions are assumed to be driving directions though you may request other modes of travel by passing a constant within the DirectionsOptions object when calling the Directions.load() method. We currently support DirectionsOptions.TRAVEL_MODE_DRIVING and DirectionsOptions.TRAVEL_MODE_WALKINGIn this example, I’m just adding the polyline of the route to the map, but Textual and HTML-formatted directions are also returned on a directions request. This data is stored within a series of one or more Route objects, each Route consisting of a segment specified in the original query, so as I specified [345 spear…..]. Each route in turn consists of one or more Step objects, which contain the turn-by-turn directions. You can retrieve the routes using the Directions.getRoute(i:Number) method and then steps within a route can be retrieved using the Route.getStep(i:Number) method. Route objects store the number of steps (of type Step) for that route, the starting and ending geocode for that route, and other computed information such as distance, duration, and exact lat/lon of the endpoint.Each Step object as well contains the description for that text (e.g. "Merge onto US-101 S via the ramp to San Jose") plus computed information including the distance, duration, and exact lat/lon. You may use the textual information returned by the Directions object to display turn-by-turn textual descriptions within any DisplayObject.
  8. The Google Maps API for Flash provides an alternative event exclusively for handling and setting up common map options: MapEvent.MAP_PREINITIALIZE. This event is triggered after a map is ready to receive initialization parameters, but before the map is ready for general use. In fact, only one Map method is allowed within this event handler: the Map.setInitOptions() method, which passes a MapOptions object.Although applications built using Google Maps API for Flash will work in both Flash 9 and Flash 10 players, 3D maps take advantage of advanced geometry support in Flash 10, so we recommend that you build your applications for that player. Note that if you build your applications for Flash 10, but use no code specific to Flash 10, your applications will still work in both Flash 9 or Flash 10, and provide a much better user experience on Flash 10 capable browsers.
  9. The ColorMatrixFilter class lets you apply a 4 x 5 matrix transformation on the RGBA color and alpha values of every pixel in the input image to produce a result with a new set of RGBA color and alpha values. So, it separates each source pixel into its red, green, blue and alpha components and then multiplies their value by the values in the transformation matrix. The filter combines each color component back into a single pixel and writes out the result. Using this,you can accomplish saturation changes, hue rotation, luminance to alpha, and various other effects. redResult = (a[0] * srcR) + (a[1] * srcG) + (a[2] * srcB) + (a[3] * srcA) + a[4]greenResult = (a[5] * srcR) + (a[6] * srcG) + (a[7] * srcB) + (a[8] * srcA) + a[9]blueResult = (a[10] * srcR) + (a[11] * srcG) + (a[12] * srcB) + (a[13] * srcA) + a[14]alphaResult = (a[15] * srcR) + (a[16] * srcG) + (a[17] * srcB) + (a[18] * srcA) + a[19]