{"id":70,"date":"2010-12-10T18:00:00","date_gmt":"2010-12-10T18:00:00","guid":{"rendered":"https:\/\/www.vineetdhanawat.com\/blog\/?p=70"},"modified":"2024-07-18T04:07:45","modified_gmt":"2024-07-18T04:07:45","slug":"detecting-geo-location-with-google-api-on-html5","status":"publish","type":"post","link":"https:\/\/www.vineetdhanawat.com\/blog\/2010\/12\/detecting-geo-location-with-google-api-on-html5\/","title":{"rendered":"Detecting Geo-location with Google API on HTML5"},"content":{"rendered":"\n<p>With the advent of HTML5, web development has taken a significant leap forward, bringing many new features and capabilities. One of the most exciting additions is the <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Geolocation_API\">Geolocation API<\/a>, which allows web developers to access a user&#8217;s location data easily. Combined with Google&#8217;s robust mapping services, this capability opens up a world of possibilities for creating location-aware web applications.<\/p>\n\n\n\n<p>In this blog post, we&#8217;ll explore how to detect geo-location using the HTML5 Geolocation API and integrate it with Google Maps to create a dynamic, interactive map that displays the user&#8217;s current location. This tutorial assumes basic knowledge of HTML, CSS, and JavaScript.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1000\" height=\"670\" src=\"https:\/\/www.vineetdhanawat.com\/blog\/wp-content\/uploads\/2024\/07\/geolocation-html5.jpg\" alt=\"\" class=\"wp-image-72\" srcset=\"https:\/\/www.vineetdhanawat.com\/blog\/wp-content\/uploads\/2024\/07\/geolocation-html5.jpg 1000w, https:\/\/www.vineetdhanawat.com\/blog\/wp-content\/uploads\/2024\/07\/geolocation-html5-300x201.jpg 300w, https:\/\/www.vineetdhanawat.com\/blog\/wp-content\/uploads\/2024\/07\/geolocation-html5-768x515.jpg 768w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">What You&#8217;ll Need<\/h2>\n\n\n\n<p>Before we get started, make sure you have the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A basic HTML file setup.<\/li>\n\n\n\n<li>An internet connection to access the Google Maps API.<\/li>\n\n\n\n<li>A modern web browser that supports HTML5 Geolocation (e.g., Google Chrome, Firefox, Safari).<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Setting Up the HTML File<\/h2>\n\n\n\n<p>Let&#8217;s begin by setting up a simple HTML file. This file will include the necessary HTML, CSS, and JavaScript to display a map and detect the user&#8217;s location.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n&lt;head&gt;\n    &lt;meta charset=\"UTF-8\"&gt;\n    &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt;\n    &lt;title&gt;Geolocation with Google API&lt;\/title&gt;\n    &lt;style&gt;\n        #map {\n            height: 400px;\n            width: 100%;\n        }\n    &lt;\/style&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n    &lt;h1&gt;Detecting Geo-location with Google API on HTML5&lt;\/h1&gt;\n    &lt;div id=\"map\"&gt;&lt;\/div&gt;\n    &lt;script src=\"https:\/\/maps.googleapis.com\/maps\/api\/js?key=YOUR_API_KEY&amp;callback=initMap\" async defer&gt;&lt;\/script&gt;\n    &lt;script&gt;\n        \/\/ Your JavaScript will go here\n    &lt;\/script&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;\n<\/code><\/pre>\n\n\n\n<p><br>In this code, we set up a basic HTML structure with an <code>div<\/code> element that will hold our map. We also include a link to the Google Maps API, which requires an API key. Make sure to replace <code>YOUR_API_KEY<\/code> with your actual Google Maps API key.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Adding the Geolocation Script<\/h2>\n\n\n\n<p>Next, we&#8217;ll add the JavaScript code that detects the user&#8217;s location and initializes the Google Map. Add the following JavaScript within the <code>&lt;script&gt;<\/code> tags in your HTML file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function initMap() {\n    if (navigator.geolocation) {\n        navigator.geolocation.getCurrentPosition(showPosition, showError);\n    } else {\n        alert(\"Geolocation is not supported by this browser.\");\n    }\n}\n\nfunction showPosition(position) {\n    var lat = position.coords.latitude;\n    var lng = position.coords.longitude;\n    var userLocation = { lat: lat, lng: lng };\n\n    var map = new google.maps.Map(document.getElementById('map'), {\n        zoom: 15,\n        center: userLocation\n    });\n\n    var marker = new google.maps.Marker({\n        position: userLocation,\n        map: map\n    });\n}\n\nfunction showError(error) {\n    switch(error.code) {\n        case error.PERMISSION_DENIED:\n            alert(\"User denied the request for Geolocation.\");\n            break;\n        case error.POSITION_UNAVAILABLE:\n            alert(\"Location information is unavailable.\");\n            break;\n        case error.TIMEOUT:\n            alert(\"The request to get user location timed out.\");\n            break;\n        case error.UNKNOWN_ERROR:\n            alert(\"An unknown error occurred.\");\n            break;\n    }\n}\n<\/code><\/pre>\n\n\n\n<p>In this script, we define several functions:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>initMap<\/code>: This function checks if the browser supports geolocation and requests the user&#8217;s current position.<\/li>\n\n\n\n<li><code>showPosition<\/code>: This function is called if the geolocation request is successful. It retrieves the user&#8217;s latitude and longitude, creates a Google Map centered at the user&#8217;s location, and places a marker on the map.<\/li>\n\n\n\n<li><code>showError<\/code>: This function handles any errors during the geolocation request and displays an appropriate message to the user.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Testing Your Application<\/h2>\n\n\n\n<p>Save your HTML file and open it in a modern web browser. If everything is set up correctly, you should see a map centered at your current location with a marker indicating your position. If there are any issues, check the browser&#8217;s console for error messages and ensure your Google Maps API key is valid and adequately included.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>With just a few lines of code, you can leverage the power of the HTML5 Geolocation API and Google Maps to create a dynamic, location-aware web application. This combination of technologies opens up many exciting possibilities, from simple location tracking to more complex applications like location-based services and real-time mapping.<\/p>\n\n\n\n<p>As you explore these technologies further, consider how you might integrate additional features such as directions, location-based search, or user-generated content to create even more engaging and valuable applications. Happy coding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With the advent of HTML5, web development has taken a significant leap forward, bringing many new features and capabilities. One of the most exciting additions is the Geolocation API, which allows web developers to access a user&#8217;s location data easily. Combined with Google&#8217;s robust mapping services, this capability opens up a world of possibilities for [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[40,42,31,41,43],"class_list":["post-70","post","type-post","status-publish","format-standard","hentry","category-article","tag-api","tag-geo","tag-google","tag-html5","tag-location"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Detecting Geo-location with Google API on HTML5 - BOTS World<\/title>\n<meta name=\"description\" content=\"Learn how to use HTML5 Geolocation API and Google Maps API to create a dynamic web application that detects and displays a user&#039;s current location. This tutorial provides step-by-step instructions and code examples to get you started.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.vineetdhanawat.com\/blog\/2010\/12\/detecting-geo-location-with-google-api-on-html5\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Detecting Geo-location with Google API on HTML5 - BOTS World\" \/>\n<meta property=\"og:description\" content=\"Learn how to use HTML5 Geolocation API and Google Maps API to create a dynamic web application that detects and displays a user&#039;s current location. This tutorial provides step-by-step instructions and code examples to get you started.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.vineetdhanawat.com\/blog\/2010\/12\/detecting-geo-location-with-google-api-on-html5\/\" \/>\n<meta property=\"og:site_name\" content=\"BOTS World\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/vineetdhanawat\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/vineetdhanawat\" \/>\n<meta property=\"article:published_time\" content=\"2010-12-10T18:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-18T04:07:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.vineetdhanawat.com\/blog\/wp-content\/uploads\/2024\/07\/geolocation-html5.jpg\" \/>\n<meta name=\"author\" content=\"Vineet Dhanawat\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vineetdhanawat\" \/>\n<meta name=\"twitter:site\" content=\"@vineetdhanawat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vineet Dhanawat\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.vineetdhanawat.com\\\/blog\\\/2010\\\/12\\\/detecting-geo-location-with-google-api-on-html5\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.vineetdhanawat.com\\\/blog\\\/2010\\\/12\\\/detecting-geo-location-with-google-api-on-html5\\\/\"},\"author\":{\"name\":\"Vineet Dhanawat\",\"@id\":\"https:\\\/\\\/www.vineetdhanawat.com\\\/blog\\\/#\\\/schema\\\/person\\\/75b6c115d758829ba3009e88a7b0fe13\"},\"headline\":\"Detecting Geo-location with Google API on HTML5\",\"datePublished\":\"2010-12-10T18:00:00+00:00\",\"dateModified\":\"2024-07-18T04:07:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.vineetdhanawat.com\\\/blog\\\/2010\\\/12\\\/detecting-geo-location-with-google-api-on-html5\\\/\"},\"wordCount\":488,\"publisher\":{\"@id\":\"https:\\\/\\\/www.vineetdhanawat.com\\\/blog\\\/#\\\/schema\\\/person\\\/75b6c115d758829ba3009e88a7b0fe13\"},\"image\":{\"@id\":\"https:\\\/\\\/www.vineetdhanawat.com\\\/blog\\\/2010\\\/12\\\/detecting-geo-location-with-google-api-on-html5\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.vineetdhanawat.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/geolocation-html5.jpg\",\"keywords\":[\"API\",\"Geo\",\"Google\",\"HTML5\",\"Location\"],\"articleSection\":[\"Article\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.vineetdhanawat.com\\\/blog\\\/2010\\\/12\\\/detecting-geo-location-with-google-api-on-html5\\\/\",\"url\":\"https:\\\/\\\/www.vineetdhanawat.com\\\/blog\\\/2010\\\/12\\\/detecting-geo-location-with-google-api-on-html5\\\/\",\"name\":\"Detecting Geo-location with Google API on HTML5 - BOTS World\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.vineetdhanawat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.vineetdhanawat.com\\\/blog\\\/2010\\\/12\\\/detecting-geo-location-with-google-api-on-html5\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.vineetdhanawat.com\\\/blog\\\/2010\\\/12\\\/detecting-geo-location-with-google-api-on-html5\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.vineetdhanawat.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/geolocation-html5.jpg\",\"datePublished\":\"2010-12-10T18:00:00+00:00\",\"dateModified\":\"2024-07-18T04:07:45+00:00\",\"description\":\"Learn how to use HTML5 Geolocation API and Google Maps API to create a dynamic web application that detects and displays a user's current location. This tutorial provides step-by-step instructions and code examples to get you started.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.vineetdhanawat.com\\\/blog\\\/2010\\\/12\\\/detecting-geo-location-with-google-api-on-html5\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.vineetdhanawat.com\\\/blog\\\/2010\\\/12\\\/detecting-geo-location-with-google-api-on-html5\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.vineetdhanawat.com\\\/blog\\\/2010\\\/12\\\/detecting-geo-location-with-google-api-on-html5\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.vineetdhanawat.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/geolocation-html5.jpg\",\"contentUrl\":\"https:\\\/\\\/www.vineetdhanawat.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/geolocation-html5.jpg\",\"width\":1000,\"height\":670},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.vineetdhanawat.com\\\/blog\\\/2010\\\/12\\\/detecting-geo-location-with-google-api-on-html5\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.vineetdhanawat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Detecting Geo-location with Google API on HTML5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.vineetdhanawat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.vineetdhanawat.com\\\/blog\\\/\",\"name\":\"BOTS World\",\"description\":\"Because writing for humans is too mainstream\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.vineetdhanawat.com\\\/blog\\\/#\\\/schema\\\/person\\\/75b6c115d758829ba3009e88a7b0fe13\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.vineetdhanawat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.vineetdhanawat.com\\\/blog\\\/#\\\/schema\\\/person\\\/75b6c115d758829ba3009e88a7b0fe13\",\"name\":\"Vineet Dhanawat\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/223097747d5be05970f383925f5b170348c9b93f1e2ad642b72ce61705c695bc?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/223097747d5be05970f383925f5b170348c9b93f1e2ad642b72ce61705c695bc?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/223097747d5be05970f383925f5b170348c9b93f1e2ad642b72ce61705c695bc?s=96&d=mm&r=g\",\"caption\":\"Vineet Dhanawat\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/223097747d5be05970f383925f5b170348c9b93f1e2ad642b72ce61705c695bc?s=96&d=mm&r=g\"},\"sameAs\":[\"https:\\\/\\\/www.vineetdhanawat.com\\\/\",\"https:\\\/\\\/www.facebook.com\\\/vineetdhanawat\",\"https:\\\/\\\/www.instagram.com\\\/vineetdhanawat\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/vineetdhanawat\\\/\",\"https:\\\/\\\/x.com\\\/vineetdhanawat\"],\"url\":\"https:\\\/\\\/www.vineetdhanawat.com\\\/blog\\\/author\\\/vineetdhanawat\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Detecting Geo-location with Google API on HTML5 - BOTS World","description":"Learn how to use HTML5 Geolocation API and Google Maps API to create a dynamic web application that detects and displays a user's current location. This tutorial provides step-by-step instructions and code examples to get you started.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.vineetdhanawat.com\/blog\/2010\/12\/detecting-geo-location-with-google-api-on-html5\/","og_locale":"en_US","og_type":"article","og_title":"Detecting Geo-location with Google API on HTML5 - BOTS World","og_description":"Learn how to use HTML5 Geolocation API and Google Maps API to create a dynamic web application that detects and displays a user's current location. This tutorial provides step-by-step instructions and code examples to get you started.","og_url":"https:\/\/www.vineetdhanawat.com\/blog\/2010\/12\/detecting-geo-location-with-google-api-on-html5\/","og_site_name":"BOTS World","article_publisher":"https:\/\/www.facebook.com\/vineetdhanawat","article_author":"https:\/\/www.facebook.com\/vineetdhanawat","article_published_time":"2010-12-10T18:00:00+00:00","article_modified_time":"2024-07-18T04:07:45+00:00","og_image":[{"url":"https:\/\/www.vineetdhanawat.com\/blog\/wp-content\/uploads\/2024\/07\/geolocation-html5.jpg","type":"","width":"","height":""}],"author":"Vineet Dhanawat","twitter_card":"summary_large_image","twitter_creator":"@vineetdhanawat","twitter_site":"@vineetdhanawat","twitter_misc":{"Written by":"Vineet Dhanawat","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.vineetdhanawat.com\/blog\/2010\/12\/detecting-geo-location-with-google-api-on-html5\/#article","isPartOf":{"@id":"https:\/\/www.vineetdhanawat.com\/blog\/2010\/12\/detecting-geo-location-with-google-api-on-html5\/"},"author":{"name":"Vineet Dhanawat","@id":"https:\/\/www.vineetdhanawat.com\/blog\/#\/schema\/person\/75b6c115d758829ba3009e88a7b0fe13"},"headline":"Detecting Geo-location with Google API on HTML5","datePublished":"2010-12-10T18:00:00+00:00","dateModified":"2024-07-18T04:07:45+00:00","mainEntityOfPage":{"@id":"https:\/\/www.vineetdhanawat.com\/blog\/2010\/12\/detecting-geo-location-with-google-api-on-html5\/"},"wordCount":488,"publisher":{"@id":"https:\/\/www.vineetdhanawat.com\/blog\/#\/schema\/person\/75b6c115d758829ba3009e88a7b0fe13"},"image":{"@id":"https:\/\/www.vineetdhanawat.com\/blog\/2010\/12\/detecting-geo-location-with-google-api-on-html5\/#primaryimage"},"thumbnailUrl":"https:\/\/www.vineetdhanawat.com\/blog\/wp-content\/uploads\/2024\/07\/geolocation-html5.jpg","keywords":["API","Geo","Google","HTML5","Location"],"articleSection":["Article"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.vineetdhanawat.com\/blog\/2010\/12\/detecting-geo-location-with-google-api-on-html5\/","url":"https:\/\/www.vineetdhanawat.com\/blog\/2010\/12\/detecting-geo-location-with-google-api-on-html5\/","name":"Detecting Geo-location with Google API on HTML5 - BOTS World","isPartOf":{"@id":"https:\/\/www.vineetdhanawat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.vineetdhanawat.com\/blog\/2010\/12\/detecting-geo-location-with-google-api-on-html5\/#primaryimage"},"image":{"@id":"https:\/\/www.vineetdhanawat.com\/blog\/2010\/12\/detecting-geo-location-with-google-api-on-html5\/#primaryimage"},"thumbnailUrl":"https:\/\/www.vineetdhanawat.com\/blog\/wp-content\/uploads\/2024\/07\/geolocation-html5.jpg","datePublished":"2010-12-10T18:00:00+00:00","dateModified":"2024-07-18T04:07:45+00:00","description":"Learn how to use HTML5 Geolocation API and Google Maps API to create a dynamic web application that detects and displays a user's current location. This tutorial provides step-by-step instructions and code examples to get you started.","breadcrumb":{"@id":"https:\/\/www.vineetdhanawat.com\/blog\/2010\/12\/detecting-geo-location-with-google-api-on-html5\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vineetdhanawat.com\/blog\/2010\/12\/detecting-geo-location-with-google-api-on-html5\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vineetdhanawat.com\/blog\/2010\/12\/detecting-geo-location-with-google-api-on-html5\/#primaryimage","url":"https:\/\/www.vineetdhanawat.com\/blog\/wp-content\/uploads\/2024\/07\/geolocation-html5.jpg","contentUrl":"https:\/\/www.vineetdhanawat.com\/blog\/wp-content\/uploads\/2024\/07\/geolocation-html5.jpg","width":1000,"height":670},{"@type":"BreadcrumbList","@id":"https:\/\/www.vineetdhanawat.com\/blog\/2010\/12\/detecting-geo-location-with-google-api-on-html5\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vineetdhanawat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Detecting Geo-location with Google API on HTML5"}]},{"@type":"WebSite","@id":"https:\/\/www.vineetdhanawat.com\/blog\/#website","url":"https:\/\/www.vineetdhanawat.com\/blog\/","name":"BOTS World","description":"Because writing for humans is too mainstream","publisher":{"@id":"https:\/\/www.vineetdhanawat.com\/blog\/#\/schema\/person\/75b6c115d758829ba3009e88a7b0fe13"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.vineetdhanawat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.vineetdhanawat.com\/blog\/#\/schema\/person\/75b6c115d758829ba3009e88a7b0fe13","name":"Vineet Dhanawat","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/223097747d5be05970f383925f5b170348c9b93f1e2ad642b72ce61705c695bc?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/223097747d5be05970f383925f5b170348c9b93f1e2ad642b72ce61705c695bc?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/223097747d5be05970f383925f5b170348c9b93f1e2ad642b72ce61705c695bc?s=96&d=mm&r=g","caption":"Vineet Dhanawat"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/223097747d5be05970f383925f5b170348c9b93f1e2ad642b72ce61705c695bc?s=96&d=mm&r=g"},"sameAs":["https:\/\/www.vineetdhanawat.com\/","https:\/\/www.facebook.com\/vineetdhanawat","https:\/\/www.instagram.com\/vineetdhanawat","https:\/\/www.linkedin.com\/in\/vineetdhanawat\/","https:\/\/x.com\/vineetdhanawat"],"url":"https:\/\/www.vineetdhanawat.com\/blog\/author\/vineetdhanawat\/"}]}},"_links":{"self":[{"href":"https:\/\/www.vineetdhanawat.com\/blog\/wp-json\/wp\/v2\/posts\/70","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vineetdhanawat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vineetdhanawat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vineetdhanawat.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vineetdhanawat.com\/blog\/wp-json\/wp\/v2\/comments?post=70"}],"version-history":[{"count":3,"href":"https:\/\/www.vineetdhanawat.com\/blog\/wp-json\/wp\/v2\/posts\/70\/revisions"}],"predecessor-version":[{"id":81,"href":"https:\/\/www.vineetdhanawat.com\/blog\/wp-json\/wp\/v2\/posts\/70\/revisions\/81"}],"wp:attachment":[{"href":"https:\/\/www.vineetdhanawat.com\/blog\/wp-json\/wp\/v2\/media?parent=70"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vineetdhanawat.com\/blog\/wp-json\/wp\/v2\/categories?post=70"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vineetdhanawat.com\/blog\/wp-json\/wp\/v2\/tags?post=70"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}