SlideShare uma empresa Scribd logo
1 de 10
Jason
Support
Geolocation API
 The Geolocation API exposes the latitude and
longitude to JavaScript in a webpage by using
the geolocation object, which is a child object
of the window.navigator.
Geolocation API - Method
 getCurrentPosition(successCallback,
[errorCallback],
[options])
 The function specified by
thesuccessCallback parameter takes
one position parameter.
 The function specified by
theerrorCallback parameter takes
one positionError parameter
Geolocation API - Geoposition
Position
Properties
Coords
Properties
Explain
coords
latitude The latitude of the location specified in
the coordinates object
longitude The longitude of the location specified in
the coordinates object
altitude Specifies the altitude, in meters, of
the coordinates object.
accuracy Gets the accuracy of the latitude
and longitude properties , in meters.
altitudeAccuracy Accuracy of the altitude property, in meters.
heading Specifies a direction of travel
speed Current ground speed of the device running
Internet Explorer, specified in meters per second.
timestamp Gets the time associated with the geographic information
Geolocation API - PositionError
Properties Explain
code Error Code
UNKNOWN_ERROR Uncertainty Error
PERMISSION_DENIED The user has denied permission for the website to access
geographic information.
POSITION_UNAVAILABLE The geographic location could not be determined.
TIMEOUT The request did not complete within the time allowed.
message Gets an error message for debugging purposes.
Geolocation API - Option
Properties Explain
enableHighAccuracy bool (false) Obtain the most accurate position possible, or
false to optimize in favor of performance and
power consumption.
timeout Integer (none) An Integer value that indicates the time, in
milliseconds, allowed for obtaining the position.
maximumAge Integer (0) An Integer value indicating the maximum age,
in milliseconds, of cached position information.
Geolocation API - Method
 watchPosition(successCallback,
[errorCallback],
[options])
 Returns :WatchID [Integer]
 Begins listening for updates to the current
geographical location of the device running
the client.
Geolocation API - Method
 clearWatch ( WatchID )
 Stops listening for updates to the current
geographical location.
Reference
 http://msdn.microsoft.com/en-
us/library/ie/hh772290(v=vs.85).aspx
 http://kuro.tw/blog/2011/12/07/html5-
geolocation-api

Mais conteúdo relacionado

Semelhante a Geoloaction

How to use geolocation in react native apps
How to use geolocation in react native appsHow to use geolocation in react native apps
How to use geolocation in react native appsInnovationM
 
Develop a native application that uses GPS location.pptx
Develop a native application that uses GPS location.pptxDevelop a native application that uses GPS location.pptx
Develop a native application that uses GPS location.pptxvishal choudhary
 
20220816-GeolocationAPI-AdvancedWebDevelopment.pptx
20220816-GeolocationAPI-AdvancedWebDevelopment.pptx20220816-GeolocationAPI-AdvancedWebDevelopment.pptx
20220816-GeolocationAPI-AdvancedWebDevelopment.pptxSuman Garai
 
Geolocation and mapping using Google Maps services
Geolocation and mapping using Google Maps servicesGeolocation and mapping using Google Maps services
Geolocation and mapping using Google Maps servicesIvano Malavolta
 
Writing java script for Csharp's Blazor
Writing java script for Csharp's BlazorWriting java script for Csharp's Blazor
Writing java script for Csharp's BlazorEd Charbeneau
 
HTML5勉強会#23_GeoHex
HTML5勉強会#23_GeoHexHTML5勉強会#23_GeoHex
HTML5勉強会#23_GeoHexTadayasu Sasada
 
Mobile geolocation and mapping
Mobile geolocation and mappingMobile geolocation and mapping
Mobile geolocation and mappingIvano Malavolta
 
Android Meetup Slovenia #2 - Making your app location-aware
Android Meetup Slovenia #2 - Making your app location-awareAndroid Meetup Slovenia #2 - Making your app location-aware
Android Meetup Slovenia #2 - Making your app location-awareInfinum
 
Infinum Android Talks #9 - Making your app location-aware
Infinum Android Talks #9 - Making your app location-awareInfinum Android Talks #9 - Making your app location-aware
Infinum Android Talks #9 - Making your app location-awareInfinum
 
Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)Luc Bors
 
Android App Development 04 : Location API
Android App Development 04 : Location APIAndroid App Development 04 : Location API
Android App Development 04 : Location APIAnuchit Chalothorn
 
Where 2.0 2008 - LocationAware.org
Where 2.0 2008 - LocationAware.orgWhere 2.0 2008 - LocationAware.org
Where 2.0 2008 - LocationAware.orgRyan Sarver
 
Mobile webapplication development
Mobile webapplication developmentMobile webapplication development
Mobile webapplication developmentGanesh Gembali
 
Developing Windows Phone Apps with Maps and Location Services
Developing Windows Phone Apps with Maps and Location ServicesDeveloping Windows Phone Apps with Maps and Location Services
Developing Windows Phone Apps with Maps and Location ServicesNick Landry
 
Writing JavaScript for C# Blazor.pptx
Writing JavaScript for C# Blazor.pptxWriting JavaScript for C# Blazor.pptx
Writing JavaScript for C# Blazor.pptxEd Charbeneau
 

Semelhante a Geoloaction (20)

How to use geolocation in react native apps
How to use geolocation in react native appsHow to use geolocation in react native apps
How to use geolocation in react native apps
 
Develop a native application that uses GPS location.pptx
Develop a native application that uses GPS location.pptxDevelop a native application that uses GPS location.pptx
Develop a native application that uses GPS location.pptx
 
Geolocation and Mapping
Geolocation and MappingGeolocation and Mapping
Geolocation and Mapping
 
20220816-GeolocationAPI-AdvancedWebDevelopment.pptx
20220816-GeolocationAPI-AdvancedWebDevelopment.pptx20220816-GeolocationAPI-AdvancedWebDevelopment.pptx
20220816-GeolocationAPI-AdvancedWebDevelopment.pptx
 
Html5 geolocation api
Html5 geolocation apiHtml5 geolocation api
Html5 geolocation api
 
Geolocation and mapping using Google Maps services
Geolocation and mapping using Google Maps servicesGeolocation and mapping using Google Maps services
Geolocation and mapping using Google Maps services
 
Writing java script for Csharp's Blazor
Writing java script for Csharp's BlazorWriting java script for Csharp's Blazor
Writing java script for Csharp's Blazor
 
HTML5勉強会#23_GeoHex
HTML5勉強会#23_GeoHexHTML5勉強会#23_GeoHex
HTML5勉強会#23_GeoHex
 
Mobile geolocation and mapping
Mobile geolocation and mappingMobile geolocation and mapping
Mobile geolocation and mapping
 
React native by example by Vadim Ruban
React native by example by Vadim RubanReact native by example by Vadim Ruban
React native by example by Vadim Ruban
 
Android Meetup Slovenia #2 - Making your app location-aware
Android Meetup Slovenia #2 - Making your app location-awareAndroid Meetup Slovenia #2 - Making your app location-aware
Android Meetup Slovenia #2 - Making your app location-aware
 
Infinum Android Talks #9 - Making your app location-aware
Infinum Android Talks #9 - Making your app location-awareInfinum Android Talks #9 - Making your app location-aware
Infinum Android Talks #9 - Making your app location-aware
 
Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)
 
Having fun with Location
Having fun with LocationHaving fun with Location
Having fun with Location
 
DIY Uber
DIY UberDIY Uber
DIY Uber
 
Android App Development 04 : Location API
Android App Development 04 : Location APIAndroid App Development 04 : Location API
Android App Development 04 : Location API
 
Where 2.0 2008 - LocationAware.org
Where 2.0 2008 - LocationAware.orgWhere 2.0 2008 - LocationAware.org
Where 2.0 2008 - LocationAware.org
 
Mobile webapplication development
Mobile webapplication developmentMobile webapplication development
Mobile webapplication development
 
Developing Windows Phone Apps with Maps and Location Services
Developing Windows Phone Apps with Maps and Location ServicesDeveloping Windows Phone Apps with Maps and Location Services
Developing Windows Phone Apps with Maps and Location Services
 
Writing JavaScript for C# Blazor.pptx
Writing JavaScript for C# Blazor.pptxWriting JavaScript for C# Blazor.pptx
Writing JavaScript for C# Blazor.pptx
 

Mais de LearningTech

Mais de LearningTech (20)

vim
vimvim
vim
 
PostCss
PostCssPostCss
PostCss
 
ReactJs
ReactJsReactJs
ReactJs
 
Docker
DockerDocker
Docker
 
Semantic ui
Semantic uiSemantic ui
Semantic ui
 
node.js errors
node.js errorsnode.js errors
node.js errors
 
Process control nodejs
Process control nodejsProcess control nodejs
Process control nodejs
 
Expression tree
Expression treeExpression tree
Expression tree
 
SQL 效能調校
SQL 效能調校SQL 效能調校
SQL 效能調校
 
flexbox report
flexbox reportflexbox report
flexbox report
 
Vic weekly learning_20160504
Vic weekly learning_20160504Vic weekly learning_20160504
Vic weekly learning_20160504
 
Reflection & activator
Reflection & activatorReflection & activator
Reflection & activator
 
Peggy markdown
Peggy markdownPeggy markdown
Peggy markdown
 
Node child process
Node child processNode child process
Node child process
 
20160415ken.lee
20160415ken.lee20160415ken.lee
20160415ken.lee
 
Peggy elasticsearch應用
Peggy elasticsearch應用Peggy elasticsearch應用
Peggy elasticsearch應用
 
Expression tree
Expression treeExpression tree
Expression tree
 
Vic weekly learning_20160325
Vic weekly learning_20160325Vic weekly learning_20160325
Vic weekly learning_20160325
 
D3js learning tips
D3js learning tipsD3js learning tips
D3js learning tips
 
git command
git commandgit command
git command
 

Último

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
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...apidays
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
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 StreamsRoshan Dwivedi
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 

Último (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
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...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 

Geoloaction

  • 3. Geolocation API  The Geolocation API exposes the latitude and longitude to JavaScript in a webpage by using the geolocation object, which is a child object of the window.navigator.
  • 4. Geolocation API - Method  getCurrentPosition(successCallback, [errorCallback], [options])  The function specified by thesuccessCallback parameter takes one position parameter.  The function specified by theerrorCallback parameter takes one positionError parameter
  • 5. Geolocation API - Geoposition Position Properties Coords Properties Explain coords latitude The latitude of the location specified in the coordinates object longitude The longitude of the location specified in the coordinates object altitude Specifies the altitude, in meters, of the coordinates object. accuracy Gets the accuracy of the latitude and longitude properties , in meters. altitudeAccuracy Accuracy of the altitude property, in meters. heading Specifies a direction of travel speed Current ground speed of the device running Internet Explorer, specified in meters per second. timestamp Gets the time associated with the geographic information
  • 6. Geolocation API - PositionError Properties Explain code Error Code UNKNOWN_ERROR Uncertainty Error PERMISSION_DENIED The user has denied permission for the website to access geographic information. POSITION_UNAVAILABLE The geographic location could not be determined. TIMEOUT The request did not complete within the time allowed. message Gets an error message for debugging purposes.
  • 7. Geolocation API - Option Properties Explain enableHighAccuracy bool (false) Obtain the most accurate position possible, or false to optimize in favor of performance and power consumption. timeout Integer (none) An Integer value that indicates the time, in milliseconds, allowed for obtaining the position. maximumAge Integer (0) An Integer value indicating the maximum age, in milliseconds, of cached position information.
  • 8. Geolocation API - Method  watchPosition(successCallback, [errorCallback], [options])  Returns :WatchID [Integer]  Begins listening for updates to the current geographical location of the device running the client.
  • 9. Geolocation API - Method  clearWatch ( WatchID )  Stops listening for updates to the current geographical location.