SlideShare a Scribd company logo
1 of 22
Download to read offline
Intro. to Google Maps API

     ericsk @ Taipei GTUG
          2009/09/30
Agenda

 Google Maps Features
   My Map & Mapplet
   Directions
   Streetview
 Google Maps API Tutorials
   How to start
   Maps API demos
   Maps API v3 for iPhone/Android
Use My Maps to Build Your Map
Use My Maps to Build Your Map (cont.)
Collaborate with Others
Sample: Morakot Typhoon SOS Map
                     collaborative map
Mapplet: Gadget on Google Maps
Directions
Directions URL

http://maps.google.com/maps?saddr=S&daddr=D
S: source address, could be address or lat,lng
D: destination address



   In general browser, it will open the Google Maps site
   and compute directions directly
   In iPhone/Android, the URL will open the Google Maps
   app on the phone and show the directions.
Sample: Google Mobile Local Seach
Streetview
Google Maps API

 API page: http://code.google.com/apis/maps/
 Put the Google Maps data on your website through the
 JavaScript/Flex/Static API.
 What you can do:
    Show data on a map
    Get directions/address lookup via GeoCoder service
    Show a streeview
    Use map as a geo input interface
    ...
Google Maps API: Quick Start

<div id="map_canvas"></div>

<script type="text/javascript"
    src="http://www.google.com/jsapi?key=YOUR_API_KEY "></script>

<script type="text/javascript">
// load google maps library (v2)
google.load('maps', 2);

google.setOnLoadCallback(function(){

    // create a Map2 instance, and draw it on #map_canvas
    var canvas = document.getElementById('map_canvas');
    var map = new google.maps.Map2(canvas, {
        size: new google.maps.Size(400, 300)
    });

    // set the center of the map
    map.setCenter(new google.maps.LatLng(25.030978,121.560287), 15);

});
</script>
Google Maps API: Quick Start (cont.)
Put a Marker on the Map

<script type="text/javascript">
// load google maps library (v2)
google.load('maps', 2);

google.setOnLoadCallback(function(){
    ....
    // create a marker
    var marker = new google.maps.Marker(
         new google.maps.LatLng(LATITUDE , LONGITUDE ), {draggable: true});

    // add the marker onto the map
    map.addOverlay(marker);
});
</script>
Listen the Event of the Marker
<script type="text/javascript">
// load google maps library (v2)
google.load('maps', 2);

google.setOnLoadCallback(function(){
    ....
  // create a marker
  var marker = new google.maps.Marker(...);

  // listen the ``dragend'' event of the marker
  google.maps.Event.addListener(marker, 'dragend',
      function(latlng) {
      // call on the dragend event is triggered
      }
  );

  // add the marker onto the map
  map.addOverlay(marker);
});
</script>
                                                     Google Maps API Ref.
Polyline & Polygon Are Also Overlays

  Ref. http://code.google.
  com/apis/maps/documentation/overlays.html
  You can also draw a geodesic polyline on map.
Google Maps Services API

 Ref. http://code.google.
 com/apis/maps/documentation/services.html
 Supported services:
    Lookup address/latlng
    Streeview Panorama object
    Load KML/GeoRSS
    AdSense on Maps
    Directions
    Traffics
 Never forget to check out Google Geo Developer Blog.
Google Static Map API

 Ref. http://code.google.
 com/apis/maps/documentation/staticmaps/
 This API is a web service that generates a map image
    Use <img src="http://....." alt=""> to use this
    API
    One client can only access 1000 times/day
 Lack of map controls but easy to use
Google Maps API v3

 Ref: http://code.google.com/apis/maps/documentation/v3/
 More efficient, smaller code size, adapted to
 iPhone/Android.
 Still preview release
Google Maps API v3 on Mobile
Devices
Q. & A.

More Related Content

What's hot

What's hot (14)

Google Maps JS API
Google Maps JS APIGoogle Maps JS API
Google Maps JS API
 
Google Developer Day 2010 Japan: Android や iPhone で活用する Maps API のモバイル端末向け新機能...
Google Developer Day 2010 Japan: Android や iPhone で活用する Maps API のモバイル端末向け新機能...Google Developer Day 2010 Japan: Android や iPhone で活用する Maps API のモバイル端末向け新機能...
Google Developer Day 2010 Japan: Android や iPhone で活用する Maps API のモバイル端末向け新機能...
 
Open Maps (Or Close Enough?)
Open Maps (Or Close Enough?)Open Maps (Or Close Enough?)
Open Maps (Or Close Enough?)
 
AvidGeo Dec 2014
AvidGeo Dec 2014AvidGeo Dec 2014
AvidGeo Dec 2014
 
Yandex Maps API
Yandex Maps APIYandex Maps API
Yandex Maps API
 
Getting Oriented with MapKit: Everything you need to get started with the new...
Getting Oriented with MapKit: Everything you need to get started with the new...Getting Oriented with MapKit: Everything you need to get started with the new...
Getting Oriented with MapKit: Everything you need to get started with the new...
 
Google Maps API
Google Maps APIGoogle Maps API
Google Maps API
 
Mapping for Academic Success
Mapping for Academic SuccessMapping for Academic Success
Mapping for Academic Success
 
Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...
Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...
Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...
 
Glympse Client SDK Overview
Glympse Client SDK OverviewGlympse Client SDK Overview
Glympse Client SDK Overview
 
Adobe MAX 2009: Making Maps with Flash
Adobe MAX 2009: Making Maps with FlashAdobe MAX 2009: Making Maps with Flash
Adobe MAX 2009: Making Maps with Flash
 
3 Approaches to Mobile - An A to Z Primer.
3 Approaches to Mobile - An A to Z Primer.3 Approaches to Mobile - An A to Z Primer.
3 Approaches to Mobile - An A to Z Primer.
 
Introduction to MapKit
Introduction to MapKitIntroduction to MapKit
Introduction to MapKit
 
Responsive Maps in WordPress
Responsive Maps in WordPressResponsive Maps in WordPress
Responsive Maps in WordPress
 

Viewers also liked

Google Map Presentation Final
Google Map Presentation FinalGoogle Map Presentation Final
Google Map Presentation Final
Frances O'Neill
 
Report on google glass(in pdf)
Report on google glass(in pdf)Report on google glass(in pdf)
Report on google glass(in pdf)
Prakhar Gupta
 

Viewers also liked (10)

How to Get Benefit from Google Maps
How to Get Benefit from Google MapsHow to Get Benefit from Google Maps
How to Get Benefit from Google Maps
 
12. Android Basic Google Map
12. Android Basic Google Map12. Android Basic Google Map
12. Android Basic Google Map
 
Google Map API
Google Map APIGoogle Map API
Google Map API
 
Google Map Presentation Final
Google Map Presentation FinalGoogle Map Presentation Final
Google Map Presentation Final
 
Google Map Is Not The Map
Google Map Is Not The MapGoogle Map Is Not The Map
Google Map Is Not The Map
 
Google glass.
Google glass.Google glass.
Google glass.
 
Must Know Google Map Features for your Web application
Must Know Google Map Features  for your Web applicationMust Know Google Map Features  for your Web application
Must Know Google Map Features for your Web application
 
Vehicle tracking system using gps and google map
Vehicle tracking system using gps and google mapVehicle tracking system using gps and google map
Vehicle tracking system using gps and google map
 
Google glass
Google glassGoogle glass
Google glass
 
Report on google glass(in pdf)
Report on google glass(in pdf)Report on google glass(in pdf)
Report on google glass(in pdf)
 

Similar to Intro To Google Maps

Android MapView and MapActivity
Android MapView and MapActivityAndroid MapView and MapActivity
Android MapView and MapActivity
Ahsanul Karim
 
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
ss318
 
Android chapter25-map views
Android chapter25-map viewsAndroid chapter25-map views
Android chapter25-map views
Tran Le Hoan
 
Online mapping with_the_google_maps_api
Online mapping with_the_google_maps_apiOnline mapping with_the_google_maps_api
Online mapping with_the_google_maps_api
Celny Quispe
 
Android mobile application for gps
Android mobile application for gpsAndroid mobile application for gps
Android mobile application for gps
Sutej Chakka
 

Similar to Intro To Google Maps (20)

Android MapView and MapActivity
Android MapView and MapActivityAndroid MapView and MapActivity
Android MapView and MapActivity
 
@Ionic native/google-maps
@Ionic native/google-maps@Ionic native/google-maps
@Ionic native/google-maps
 
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
 
Angular google maps tutorial quick guide
Angular google maps tutorial quick guideAngular google maps tutorial quick guide
Angular google maps tutorial quick guide
 
Android chapter25-map views
Android chapter25-map viewsAndroid chapter25-map views
Android chapter25-map views
 
Maps in android
Maps in androidMaps in android
Maps in android
 
GoogleVisualr - A Ruby library for Google Visualization API
GoogleVisualr - A Ruby library for Google Visualization APIGoogleVisualr - A Ruby library for Google Visualization API
GoogleVisualr - A Ruby library for Google Visualization API
 
GIS in the Rockies 2011: Building Distributed JavaScript Map Widgets with Ope...
GIS in the Rockies 2011: Building Distributed JavaScript Map Widgets with Ope...GIS in the Rockies 2011: Building Distributed JavaScript Map Widgets with Ope...
GIS in the Rockies 2011: Building Distributed JavaScript Map Widgets with Ope...
 
Android L08 - Google Maps and Utilities
Android L08 - Google Maps and UtilitiesAndroid L08 - Google Maps and Utilities
Android L08 - Google Maps and Utilities
 
Tools Of The Geospatial Web
Tools Of The Geospatial WebTools Of The Geospatial Web
Tools Of The Geospatial Web
 
Online mapping with_the_google_maps_api
Online mapping with_the_google_maps_apiOnline mapping with_the_google_maps_api
Online mapping with_the_google_maps_api
 
Google Map Code
Google Map CodeGoogle Map Code
Google Map Code
 
Code to Add Google Map to Websites
Code to Add Google Map to WebsitesCode to Add Google Map to Websites
Code to Add Google Map to Websites
 
Location Based Services Without the Cocoa
Location Based Services Without the CocoaLocation Based Services Without the Cocoa
Location Based Services Without the Cocoa
 
Sirius Web Advanced : Customize and Extend the Platform
Sirius Web Advanced : Customize and Extend the PlatformSirius Web Advanced : Customize and Extend the Platform
Sirius Web Advanced : Customize and Extend the Platform
 
Google maps platform product pitch deck
Google maps platform   product pitch deck Google maps platform   product pitch deck
Google maps platform product pitch deck
 
Gmaps Railscamp2008
Gmaps Railscamp2008Gmaps Railscamp2008
Gmaps Railscamp2008
 
Google Geo APIs Overview
Google Geo APIs OverviewGoogle Geo APIs Overview
Google Geo APIs Overview
 
android level 3
android level 3android level 3
android level 3
 
Android mobile application for gps
Android mobile application for gpsAndroid mobile application for gps
Android mobile application for gps
 

More from Eric ShangKuan

Internet Explorer 10: 重新想像網站設計
Internet Explorer 10: 重新想像網站設計Internet Explorer 10: 重新想像網站設計
Internet Explorer 10: 重新想像網站設計
Eric ShangKuan
 
透過 Windows Azure Mobile Services 開發各平台 Apps
透過 Windows Azure Mobile Services 開發各平台 Apps透過 Windows Azure Mobile Services 開發各平台 Apps
透過 Windows Azure Mobile Services 開發各平台 Apps
Eric ShangKuan
 
Metro Style Apps from C++ Developers' View
Metro Style Apps from C++ Developers' ViewMetro Style Apps from C++ Developers' View
Metro Style Apps from C++ Developers' View
Eric ShangKuan
 
Tuning Web Performance
Tuning Web PerformanceTuning Web Performance
Tuning Web Performance
Eric ShangKuan
 

More from Eric ShangKuan (16)

運用 Azure Custom Vision 輕鬆開發智慧視覺應用程式
運用 Azure Custom Vision 輕鬆開發智慧視覺應用程式運用 Azure Custom Vision 輕鬆開發智慧視覺應用程式
運用 Azure Custom Vision 輕鬆開發智慧視覺應用程式
 
Introducing .NET Core Open Source
Introducing .NET Core Open SourceIntroducing .NET Core Open Source
Introducing .NET Core Open Source
 
In
InIn
In
 
Azure machine learning overview
Azure machine learning overviewAzure machine learning overview
Azure machine learning overview
 
Internet Explorer 10: 重新想像網站設計
Internet Explorer 10: 重新想像網站設計Internet Explorer 10: 重新想像網站設計
Internet Explorer 10: 重新想像網站設計
 
透過 Windows Azure Mobile Services 開發各平台 Apps
透過 Windows Azure Mobile Services 開發各平台 Apps透過 Windows Azure Mobile Services 開發各平台 Apps
透過 Windows Azure Mobile Services 開發各平台 Apps
 
Metro Style Apps from C++ Developers' View
Metro Style Apps from C++ Developers' ViewMetro Style Apps from C++ Developers' View
Metro Style Apps from C++ Developers' View
 
Building Python Applications on Windows Azure
Building Python Applications on Windows AzureBuilding Python Applications on Windows Azure
Building Python Applications on Windows Azure
 
Microsoft and jQuery
Microsoft and jQueryMicrosoft and jQuery
Microsoft and jQuery
 
Tuning Web Performance
Tuning Web PerformanceTuning Web Performance
Tuning Web Performance
 
Practical Google App Engine Applications In Py
Practical Google App Engine Applications In PyPractical Google App Engine Applications In Py
Practical Google App Engine Applications In Py
 
An Introduction to GAEO web framework
An Introduction to GAEO web frameworkAn Introduction to GAEO web framework
An Introduction to GAEO web framework
 
Intro. to JavaScript
Intro. to JavaScriptIntro. to JavaScript
Intro. to JavaScript
 
Intro. to CSS
Intro. to CSSIntro. to CSS
Intro. to CSS
 
jQuery Tutorial
jQuery TutorialjQuery Tutorial
jQuery Tutorial
 
The Google App Engine Oil Framework
The Google App Engine Oil FrameworkThe Google App Engine Oil Framework
The Google App Engine Oil Framework
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

Intro To Google Maps

  • 1. Intro. to Google Maps API ericsk @ Taipei GTUG 2009/09/30
  • 2. Agenda Google Maps Features My Map & Mapplet Directions Streetview Google Maps API Tutorials How to start Maps API demos Maps API v3 for iPhone/Android
  • 3. Use My Maps to Build Your Map
  • 4. Use My Maps to Build Your Map (cont.)
  • 6. Sample: Morakot Typhoon SOS Map collaborative map
  • 7. Mapplet: Gadget on Google Maps
  • 9. Directions URL http://maps.google.com/maps?saddr=S&daddr=D S: source address, could be address or lat,lng D: destination address In general browser, it will open the Google Maps site and compute directions directly In iPhone/Android, the URL will open the Google Maps app on the phone and show the directions.
  • 10. Sample: Google Mobile Local Seach
  • 12. Google Maps API API page: http://code.google.com/apis/maps/ Put the Google Maps data on your website through the JavaScript/Flex/Static API. What you can do: Show data on a map Get directions/address lookup via GeoCoder service Show a streeview Use map as a geo input interface ...
  • 13. Google Maps API: Quick Start <div id="map_canvas"></div> <script type="text/javascript" src="http://www.google.com/jsapi?key=YOUR_API_KEY "></script> <script type="text/javascript"> // load google maps library (v2) google.load('maps', 2); google.setOnLoadCallback(function(){ // create a Map2 instance, and draw it on #map_canvas var canvas = document.getElementById('map_canvas'); var map = new google.maps.Map2(canvas, { size: new google.maps.Size(400, 300) }); // set the center of the map map.setCenter(new google.maps.LatLng(25.030978,121.560287), 15); }); </script>
  • 14. Google Maps API: Quick Start (cont.)
  • 15. Put a Marker on the Map <script type="text/javascript"> // load google maps library (v2) google.load('maps', 2); google.setOnLoadCallback(function(){ .... // create a marker var marker = new google.maps.Marker( new google.maps.LatLng(LATITUDE , LONGITUDE ), {draggable: true}); // add the marker onto the map map.addOverlay(marker); }); </script>
  • 16. Listen the Event of the Marker <script type="text/javascript"> // load google maps library (v2) google.load('maps', 2); google.setOnLoadCallback(function(){ .... // create a marker var marker = new google.maps.Marker(...); // listen the ``dragend'' event of the marker google.maps.Event.addListener(marker, 'dragend', function(latlng) { // call on the dragend event is triggered } ); // add the marker onto the map map.addOverlay(marker); }); </script> Google Maps API Ref.
  • 17. Polyline & Polygon Are Also Overlays Ref. http://code.google. com/apis/maps/documentation/overlays.html You can also draw a geodesic polyline on map.
  • 18. Google Maps Services API Ref. http://code.google. com/apis/maps/documentation/services.html Supported services: Lookup address/latlng Streeview Panorama object Load KML/GeoRSS AdSense on Maps Directions Traffics Never forget to check out Google Geo Developer Blog.
  • 19. Google Static Map API Ref. http://code.google. com/apis/maps/documentation/staticmaps/ This API is a web service that generates a map image Use <img src="http://....." alt=""> to use this API One client can only access 1000 times/day Lack of map controls but easy to use
  • 20. Google Maps API v3 Ref: http://code.google.com/apis/maps/documentation/v3/ More efficient, smaller code size, adapted to iPhone/Android. Still preview release
  • 21. Google Maps API v3 on Mobile Devices