SlideShare una empresa de Scribd logo
1 de 15
Descargar para leer sin conexión
Google Maps API 101 
Sebastian Roming 
GDG Black Forest
What do I need? 
- your favourite IDE 
- Access to the Internet 
That’s all!
http://developers.google.com
Resources 
-
Basics 
Loading Maps API to your website: 
<script src='https://maps.googleapis.com/maps/api/js?sensor=false'> 
</script> 
Create a Map Container 
<div id='mapContainer'></div>
Basics 
<script> 
var mapObject; 
function initMap() { 
mapObject = new google.maps.Map( document.getElementById 
('mapContainer'), { 
center: new google.maps.LatLng(48.210, 8.515), 
zoom: 14 
}); 
} 
google.maps.event.addDomListener(window, 'load', initMap); 
</script> 
Our Map Container
<!DOCTYPE html> 
<html> 
<head> 
<meta charset ='utf-8'> 
<title> Google Maps API 101 - Example 1 </title> 
<script src='https://maps.googleapis.com/maps/api/js?sensor=false '></script> 
<style> #mapContainer { width:800px; height:400px; } </style> 
</head> 
<body> 
<div id='mapContainer '></div> 
<script> 
var mapObject; 
function initMap () { 
mapObject = new google.maps.Map(document.getElementById ('mapContainer '), { 
center: new google.maps.LatLng (48.210 , 8.515), 
zoom: 14 
}); 
} 
google.maps.event.addDomListener (window, ' load', initMap ); 
</script> 
</body> 
</html> 
Working!
Extend 
Adding a marker to the map 
var marker = new google.maps.Marker({ 
position: new google.maps.LatLng(48.210, 8.515), 
map: mapObject 
});
Features 
- Map styling 
- Custom shapes / markers 
- StreetView 
- Places 
- Geocoding 
- many, many more...
Style your map 
- Adding / removing controls 
- Positioning the controls 
- Adding overlays 
- … 
Be creative, everything is possible!
Translate address to coordinates 
(or vice versa) 
var geocoder = new google.maps.Geocoder(); 
[...] 
Sends request and gets google.maps. 
GeocoderStatus and a result (if there is 
one). 
Geocoding
DrawingManager 
Can draw shapes and markers 
var drawing = new google.maps.drawing.DrawingManager({ 
drawingControlOptions: { 
position: google.maps.ControlPosition.TOP_CENTER 
} 
});
Need to know 
Object google.maps = 42!
Want more? 
Gentlemen, start your IDE. 
Let´s code.
Thank you. 
@sebastianroming 
github.com/sebastianroming 
github.com/GDGBlackForest

Más contenido relacionado

La actualidad más candente

GeoNerdsDC Presentation 2011-08-02
GeoNerdsDC Presentation 2011-08-02GeoNerdsDC Presentation 2011-08-02
GeoNerdsDC Presentation 2011-08-02
Glenn Waldron
 
Android Kit Kat - Printing Framework
Android Kit Kat - Printing FrameworkAndroid Kit Kat - Printing Framework
Android Kit Kat - Printing Framework
Paul Lammertsma
 
Printing photos-html-using-android
Printing photos-html-using-androidPrinting photos-html-using-android
Printing photos-html-using-android
Ketan Raval
 
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
 
Webgl para JavaScripters
Webgl para JavaScriptersWebgl para JavaScripters
Webgl para JavaScripters
gerbille
 

La actualidad más candente (13)

GeoNerdsDC Presentation 2011-08-02
GeoNerdsDC Presentation 2011-08-02GeoNerdsDC Presentation 2011-08-02
GeoNerdsDC Presentation 2011-08-02
 
FOSS4G-NA 2012 : ReadyMap - OpenLayers in 3D
FOSS4G-NA 2012 : ReadyMap - OpenLayers in 3DFOSS4G-NA 2012 : ReadyMap - OpenLayers in 3D
FOSS4G-NA 2012 : ReadyMap - OpenLayers in 3D
 
Using SharePoint's Geolocation Field - SPSUK 2014
Using SharePoint's Geolocation Field - SPSUK 2014Using SharePoint's Geolocation Field - SPSUK 2014
Using SharePoint's Geolocation Field - SPSUK 2014
 
Mapping with Drupal and OpenLayers
Mapping with Drupal and OpenLayersMapping with Drupal and OpenLayers
Mapping with Drupal and OpenLayers
 
Google Cloud lightning talk @MHacks
Google Cloud lightning talk @MHacksGoogle Cloud lightning talk @MHacks
Google Cloud lightning talk @MHacks
 
Android Kit Kat - Printing Framework
Android Kit Kat - Printing FrameworkAndroid Kit Kat - Printing Framework
Android Kit Kat - Printing Framework
 
Make Android development easier
Make Android development easierMake Android development easier
Make Android development easier
 
Responsive Maps in WordPress
Responsive Maps in WordPressResponsive Maps in WordPress
Responsive Maps in WordPress
 
Printing photos-html-using-android
Printing photos-html-using-androidPrinting photos-html-using-android
Printing photos-html-using-android
 
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
 
@Ionic native/google-maps
@Ionic native/google-maps@Ionic native/google-maps
@Ionic native/google-maps
 
Google Cloud @ Hackathons (2020)
Google Cloud @ Hackathons (2020)Google Cloud @ Hackathons (2020)
Google Cloud @ Hackathons (2020)
 
Webgl para JavaScripters
Webgl para JavaScriptersWebgl para JavaScripters
Webgl para JavaScripters
 

Destacado

Marcel Peek, Nederland 1, Presentatie #NPOX Slots & Genres 2011
Marcel Peek, Nederland 1, Presentatie #NPOX Slots & Genres 2011Marcel Peek, Nederland 1, Presentatie #NPOX Slots & Genres 2011
Marcel Peek, Nederland 1, Presentatie #NPOX Slots & Genres 2011
NPOX
 
óCeánok, tengerek varázsa(7)+ani (nx power lite)
óCeánok, tengerek varázsa(7)+ani (nx power lite)óCeánok, tengerek varázsa(7)+ani (nx power lite)
óCeánok, tengerek varázsa(7)+ani (nx power lite)
VarganeAnny
 
CREMP TECH OAP
CREMP TECH OAPCREMP TECH OAP
CREMP TECH OAP
cremptech
 
N ds tanzania-presentation2
N ds tanzania-presentation2N ds tanzania-presentation2
N ds tanzania-presentation2
Julien Grollier
 
Gerunds and infinitives
Gerunds and infinitivesGerunds and infinitives
Gerunds and infinitives
jolehidy6
 
Book vernissage rashid-s_kaukab
Book vernissage rashid-s_kaukabBook vernissage rashid-s_kaukab
Book vernissage rashid-s_kaukab
Julien Grollier
 
N ds uganda-presentation2
N ds uganda-presentation2N ds uganda-presentation2
N ds uganda-presentation2
Julien Grollier
 
Csodás világ(4)+ani (nx powerlite)
Csodás világ(4)+ani (nx powerlite)Csodás világ(4)+ani (nx powerlite)
Csodás világ(4)+ani (nx powerlite)
VarganeAnny
 
Keukenhof virágai(1)+ani (nx power lite)
Keukenhof virágai(1)+ani (nx power lite)Keukenhof virágai(1)+ani (nx power lite)
Keukenhof virágai(1)+ani (nx power lite)
VarganeAnny
 
Collaboration sig-pitch
Collaboration sig-pitchCollaboration sig-pitch
Collaboration sig-pitch
Daniela Papi
 

Destacado (20)

Integrating Google APIs into Your Applications
Integrating Google APIs into Your ApplicationsIntegrating Google APIs into Your Applications
Integrating Google APIs into Your Applications
 
Google Maps API for Android
Google Maps API for AndroidGoogle Maps API for Android
Google Maps API for Android
 
Google Maps
Google MapsGoogle Maps
Google Maps
 
Google Maps Presentation
Google Maps PresentationGoogle Maps Presentation
Google Maps Presentation
 
Isoft web
Isoft webIsoft web
Isoft web
 
Marcel Peek, Nederland 1, Presentatie #NPOX Slots & Genres 2011
Marcel Peek, Nederland 1, Presentatie #NPOX Slots & Genres 2011Marcel Peek, Nederland 1, Presentatie #NPOX Slots & Genres 2011
Marcel Peek, Nederland 1, Presentatie #NPOX Slots & Genres 2011
 
óCeánok, tengerek varázsa(7)+ani (nx power lite)
óCeánok, tengerek varázsa(7)+ani (nx power lite)óCeánok, tengerek varázsa(7)+ani (nx power lite)
óCeánok, tengerek varázsa(7)+ani (nx power lite)
 
Venecia
VeneciaVenecia
Venecia
 
Social Media: What Is It? Why You Need Strategy & How To Get It.
Social Media: What Is It? Why You Need Strategy & How To Get It.Social Media: What Is It? Why You Need Strategy & How To Get It.
Social Media: What Is It? Why You Need Strategy & How To Get It.
 
CREMP TECH OAP
CREMP TECH OAPCREMP TECH OAP
CREMP TECH OAP
 
Kenya presentation2
Kenya presentation2Kenya presentation2
Kenya presentation2
 
N ds tanzania-presentation2
N ds tanzania-presentation2N ds tanzania-presentation2
N ds tanzania-presentation2
 
Gerunds and infinitives
Gerunds and infinitivesGerunds and infinitives
Gerunds and infinitives
 
Een therapie voor geluidsovergevoeligheid (Hyperacusis) en Tinnitus
Een therapie voor geluidsovergevoeligheid (Hyperacusis) en TinnitusEen therapie voor geluidsovergevoeligheid (Hyperacusis) en Tinnitus
Een therapie voor geluidsovergevoeligheid (Hyperacusis) en Tinnitus
 
Book vernissage rashid-s_kaukab
Book vernissage rashid-s_kaukabBook vernissage rashid-s_kaukab
Book vernissage rashid-s_kaukab
 
N ds uganda-presentation2
N ds uganda-presentation2N ds uganda-presentation2
N ds uganda-presentation2
 
Csodás világ(4)+ani (nx powerlite)
Csodás világ(4)+ani (nx powerlite)Csodás világ(4)+ani (nx powerlite)
Csodás világ(4)+ani (nx powerlite)
 
Keukenhof virágai(1)+ani (nx power lite)
Keukenhof virágai(1)+ani (nx power lite)Keukenhof virágai(1)+ani (nx power lite)
Keukenhof virágai(1)+ani (nx power lite)
 
Living Well with Cancer
Living Well with CancerLiving Well with Cancer
Living Well with Cancer
 
Collaboration sig-pitch
Collaboration sig-pitchCollaboration sig-pitch
Collaboration sig-pitch
 

Similar a Google Maps API 101

Barcamp GoogleMaps - praktické ukázky kódu
Barcamp GoogleMaps - praktické ukázky kóduBarcamp GoogleMaps - praktické ukázky kódu
Barcamp GoogleMaps - praktické ukázky kódu
Milos Lenoch
 
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
 
Grails : Ordr, Maps & Charts
Grails : Ordr, Maps & ChartsGrails : Ordr, Maps & Charts
Grails : Ordr, Maps & Charts
Henk Jurriens
 
Android MapView and MapActivity
Android MapView and MapActivityAndroid MapView and MapActivity
Android MapView and MapActivity
Ahsanul Karim
 
Gis SAPO Hands On
Gis SAPO Hands OnGis SAPO Hands On
Gis SAPO Hands On
codebits
 
Sapo GIS Hands-On
Sapo GIS Hands-OnSapo GIS Hands-On
Sapo GIS Hands-On
codebits
 
Cloud Endpoints _Polymer_ Material design by Martin Görner
Cloud Endpoints_Polymer_Material design by Martin GörnerCloud Endpoints_Polymer_Material design by Martin Görner
Cloud Endpoints _Polymer_ Material design by Martin Görner
European Innovation Academy
 

Similar a Google Maps API 101 (20)

Gmaps Railscamp2008
Gmaps Railscamp2008Gmaps Railscamp2008
Gmaps Railscamp2008
 
Intro To Google Maps
Intro To Google MapsIntro To Google Maps
Intro To Google Maps
 
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
 
Barcamp GoogleMaps - praktické ukázky kódu
Barcamp GoogleMaps - praktické ukázky kóduBarcamp GoogleMaps - praktické ukázky kódu
Barcamp GoogleMaps - praktické ukázky kódu
 
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
 
The Future of CSS with Web components
The Future of CSS with Web componentsThe Future of CSS with Web components
The Future of CSS with Web components
 
The Future of CSS with Web Components
The Future of CSS with Web ComponentsThe Future of CSS with Web Components
The Future of CSS with Web Components
 
AngularJS: The Bridge Between Today and Tomorrow's Web (Todd Motto)
AngularJS: The Bridge Between Today and Tomorrow's Web (Todd Motto)AngularJS: The Bridge Between Today and Tomorrow's Web (Todd Motto)
AngularJS: The Bridge Between Today and Tomorrow's Web (Todd Motto)
 
Grails : Ordr, Maps & Charts
Grails : Ordr, Maps & ChartsGrails : Ordr, Maps & Charts
Grails : Ordr, Maps & Charts
 
Android MapView and MapActivity
Android MapView and MapActivityAndroid MapView and MapActivity
Android MapView and MapActivity
 
Developing Spatial Applications with Google Maps and CARTO
Developing Spatial Applications with Google Maps and CARTODeveloping Spatial Applications with Google Maps and CARTO
Developing Spatial Applications with Google Maps and CARTO
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics
 
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
 
executive-mba-pune.pdf
executive-mba-pune.pdfexecutive-mba-pune.pdf
executive-mba-pune.pdf
 
Introduction to angular js
Introduction to angular jsIntroduction to angular js
Introduction to angular js
 
Gis SAPO Hands On
Gis SAPO Hands OnGis SAPO Hands On
Gis SAPO Hands On
 
Sapo GIS Hands-On
Sapo GIS Hands-OnSapo GIS Hands-On
Sapo GIS Hands-On
 
Recoil at Codete Webinars #3
Recoil at Codete Webinars #3Recoil at Codete Webinars #3
Recoil at Codete Webinars #3
 
Cloud Endpoints _Polymer_ Material design by Martin Görner
Cloud Endpoints_Polymer_Material design by Martin GörnerCloud Endpoints_Polymer_Material design by Martin Görner
Cloud Endpoints _Polymer_ Material design by Martin Görner
 
Mobile Application Development for the Web Developer
Mobile Application Development for the Web DeveloperMobile Application Development for the Web Developer
Mobile Application Development for the Web Developer
 

Último

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
panagenda
 

Último (20)

Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 

Google Maps API 101

  • 1. Google Maps API 101 Sebastian Roming GDG Black Forest
  • 2. What do I need? - your favourite IDE - Access to the Internet That’s all!
  • 5. Basics Loading Maps API to your website: <script src='https://maps.googleapis.com/maps/api/js?sensor=false'> </script> Create a Map Container <div id='mapContainer'></div>
  • 6. Basics <script> var mapObject; function initMap() { mapObject = new google.maps.Map( document.getElementById ('mapContainer'), { center: new google.maps.LatLng(48.210, 8.515), zoom: 14 }); } google.maps.event.addDomListener(window, 'load', initMap); </script> Our Map Container
  • 7. <!DOCTYPE html> <html> <head> <meta charset ='utf-8'> <title> Google Maps API 101 - Example 1 </title> <script src='https://maps.googleapis.com/maps/api/js?sensor=false '></script> <style> #mapContainer { width:800px; height:400px; } </style> </head> <body> <div id='mapContainer '></div> <script> var mapObject; function initMap () { mapObject = new google.maps.Map(document.getElementById ('mapContainer '), { center: new google.maps.LatLng (48.210 , 8.515), zoom: 14 }); } google.maps.event.addDomListener (window, ' load', initMap ); </script> </body> </html> Working!
  • 8. Extend Adding a marker to the map var marker = new google.maps.Marker({ position: new google.maps.LatLng(48.210, 8.515), map: mapObject });
  • 9. Features - Map styling - Custom shapes / markers - StreetView - Places - Geocoding - many, many more...
  • 10. Style your map - Adding / removing controls - Positioning the controls - Adding overlays - … Be creative, everything is possible!
  • 11. Translate address to coordinates (or vice versa) var geocoder = new google.maps.Geocoder(); [...] Sends request and gets google.maps. GeocoderStatus and a result (if there is one). Geocoding
  • 12. DrawingManager Can draw shapes and markers var drawing = new google.maps.drawing.DrawingManager({ drawingControlOptions: { position: google.maps.ControlPosition.TOP_CENTER } });
  • 13. Need to know Object google.maps = 42!
  • 14. Want more? Gentlemen, start your IDE. Let´s code.
  • 15. Thank you. @sebastianroming github.com/sebastianroming github.com/GDGBlackForest