{"id":113,"date":"2018-03-25T06:32:16","date_gmt":"2018-03-25T06:32:16","guid":{"rendered":"http:\/\/demos.codexcoder.com\/reveal\/mission-critical-synergy-for-copy-3-copy\/"},"modified":"2018-06-25T04:23:28","modified_gmt":"2018-06-25T04:23:28","slug":"mission-critical-synergy-for-copy-3-copy","status":"publish","type":"post","link":"https:\/\/demos.codexcoder.com\/reveal\/mission-critical-synergy-for-copy-3-copy\/","title":{"rendered":"How to Create Google Map Using HTML5 and JavaScript"},"content":{"rendered":"<p>Google Maps JavaScript API is an easy-to-use and fairly powerful JavaScript tool that allows us to form and show maps on an internet site. This article will guide you in setting Google Maps JS API, so building a straightforward map that contains a marker and a polyline form, and a couple of different options. It helps to learn How to Create Google Map Using HTML5 and JavaScript.<\/p>\n<h3>How To Create A Simple Google Map API Application<\/h3>\n<p>To create an HTML5 google map, the browser you interact with must support HTML5. This means that you need to use newer browser versions, such as Internet Explorer 9.<\/p>\n<p>Many website use maps for all sorts of interesting purposes. This\u00a0article\u00a0provides some additional ideas on how you can use the Google Maps API with your browser-based application.<br \/>\nFor creating a google map application, you need to know html, css, js.<\/p>\n<h2>HTML:<\/h2>\n<p>HTML is used to create the markup of the pages. I\u2019ll use some new HTML5 tags for creating this google map.<\/p>\n<h2>CSS:<\/h2>\n<p>Since most of the CSS enhancements are done by jQuery, it isn\u2019t extremely required extensively. However, I\u2019ll use a few rules to correct or modify some designs as you\u2019ll see later.<\/p>\n<h2>JavaScript:<\/h2>\n<p>The business logic is entirely written in JavaScript; therefore if you don\u2019t apprehend some key ideas like what\u2019s a Callback or a closure, you need to study it before continuing.<\/p>\n<h2>Need A Developer Key<\/h2>\n<p>To use this instance, you want to acquire a developer key.\u00a0<strong>Google provides two types key: paid and free.<\/strong>\u00a0You would like the free key for this instance. The paid key will give significant additional flexibility, and you\u2019ll doubtless want it for any full-fledged application you will create.<\/p>\n<p>However, for experimentation functions, the free key works simply fine. Check that you perceive the terms of service absolutely before you start operating with the Google Maps API. You\u2019ll additionally notice some extra help in using the Google Maps API with JavaScript.<\/p>\n<h3>Now Create Google Map Application<\/h3>\n<p>The easiest way to begin learning regarding the Google Maps JavaScript API is to examine an easy example. The following content displays a map focused on Dhaka, Bangladesh.<\/p>\n<p><strong>Read Also:\u00a0<a href=\"https:\/\/www.codexcoder.com\/products\/top-news-newsmagazine-wordpress-theme\/\">The Best News, Magazine, Blog and Multipurpose Theme<\/a><\/strong><\/p>\n<h2><u>Step-1<\/u><\/h2>\n<h4>Create An HTML file<\/h4>\n<p>Open your webpage. If you do not have already have a webpage you would like to insert the map into a new webpage or html file. You\u2019ll use the following HTML5 template; reserve it as \u2018map.html\u2019.<\/p>\n<pre>&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n\t&lt;head&gt;\r\n\t\t&lt;meta charset=\"utf-8\"&gt;\r\n\t\t&lt;meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"&gt;\r\n\t\t&lt;title&gt;Google Map&lt;\/title&gt;\r\n\t\t&lt;link rel=\"stylesheet\" href=\"#\"&gt;\r\n\t&lt;\/head&gt;\r\n\t&lt;body&gt;\r\n\t\t&lt;div id=\"map\" &gt;&lt;\/div&gt;\r\n\t&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n\r\n<\/pre>\n<h2><u>Step-2<\/u><\/h2>\n<h4>Style the Map Container<\/h4>\n<p>You need to set how large the map will be when it is displayed, and you should use CSS to do this. You can add the following to the document &lt;head&gt;&lt;\/head&gt;<\/p>\n<pre>\t\r\n&lt;style&gt;\r\n\t#map {\r\n        height: 500px;\r\n        width: 100%;\r\n   \t }\r\n&lt;\/style&gt;\r\n\r\n<\/pre>\n<h2><u>Step-3<\/u><\/h2>\n<h4>Include the Google Maps JS file<\/h4>\n<p>To do this, paste the following line of codes into your HTML file, inside the &lt;body&gt;&lt;\/body&gt; area, on a new line, just before the closing &lt;\/body&gt; tag.<\/p>\n<pre>\t\r\n&lt;script async defer\r\n\t\tsrc=\"https:\/\/maps.googleapis.com\/maps\/api\/js? callback=initMap\"&gt;\r\n&lt;\/script&gt;\r\n    \r\n<\/pre>\n<p>The URL contained within the script tag is that the location of a JavaScript file that gets all of the symbols and definitions you wish for using the Maps JavaScript API. This script tag is needed.<\/p>\n<p>The async attribute lets the browser render the remainder of your website where the Maps JavaScript API gets. Once the API is prepared, it\u2019ll call the function fixed using the callback parameter.<\/p>\n<h2><u>Step-4<\/u><\/h2>\n<h4>Create the Map Object<\/h4>\n<p>To start writing the JavaScript code that sets up the map, you\u2019ll need to add a &lt;script&gt;&lt;\/script&gt; area to the &lt;body&gt;&lt;\/body&gt; after the map container div. Also inside of this, you can create the map object by calling the Map() function of the google maps object. You will also need to write the function to map container html element.<\/p>\n<pre>\t\r\n&lt;script&gt;\r\n      \tfunction initMap() {\r\n        \tvar dhaka = {lat: 23.777176, lng: 90.399452};\r\n        \tvar map = new google.maps.Map(document.getElementById('map'), {\r\n          \t\tzoom: 4,\r\n          \t\tcenter: dhaka\r\n        \t});\r\n        \tvar marker = new google.maps.Marker({\r\n          \t\tposition: dhaka,\r\n          \t\tmap: map\r\n        \t});\r\n      \t}\r\n&lt;\/script&gt;\r\n    \r\n<\/pre>\n<p>To make it easier to browse a part, the instance provides spinner controls for the latitude and longitude inputs. Moving a whole degree at a time wouldn\u2019t build the application terribly helpful, therefore the two spinner\u2019s modification the inputs by a tenth of a degree at a time.<\/p>\n<p>Notice the employment of the step choice to perform this task. Latitudes vary from 90 degrees north to -90 degrees south, therefore the example reflects this demand. Likewise, longitudes vary from 180 degrees west to \u2013180 degrees east of Greenwich, England.<\/p>\n<h3>Get Latitude and Longitude<\/h3>\n<p>Latitude and Longitude Finder on Map Get Coordinates\u00a0<a href=\"https:\/\/www.latlong.net\/\" target=\"_blank\" rel=\"noopener\">https:\/\/www.latlong.net\/<\/a><\/p>\n<p>Hope, these guidelines will help you and if you have any question, please ask us freely through commenting or you can contact us with\u00a0<a href=\"https:\/\/www.codexcoder.com\/contact-us\/\">contact us page<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Google Maps JavaScript API is an easy-to-use and fairly powerful JavaScript tool that allows us to form and show maps on an internet site. This article will guide you in setting Google Maps JS API, so building a straightforward map that contains a marker and a polyline form, and a couple of different options. It [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":146,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,5,4,3],"tags":[],"class_list":["post-113","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-business","category-journey","category-tour","category-travel"],"_links":{"self":[{"href":"https:\/\/demos.codexcoder.com\/reveal\/wp-json\/wp\/v2\/posts\/113","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/demos.codexcoder.com\/reveal\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/demos.codexcoder.com\/reveal\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/demos.codexcoder.com\/reveal\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/demos.codexcoder.com\/reveal\/wp-json\/wp\/v2\/comments?post=113"}],"version-history":[{"count":3,"href":"https:\/\/demos.codexcoder.com\/reveal\/wp-json\/wp\/v2\/posts\/113\/revisions"}],"predecessor-version":[{"id":171,"href":"https:\/\/demos.codexcoder.com\/reveal\/wp-json\/wp\/v2\/posts\/113\/revisions\/171"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/demos.codexcoder.com\/reveal\/wp-json\/wp\/v2\/media\/146"}],"wp:attachment":[{"href":"https:\/\/demos.codexcoder.com\/reveal\/wp-json\/wp\/v2\/media?parent=113"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/demos.codexcoder.com\/reveal\/wp-json\/wp\/v2\/categories?post=113"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/demos.codexcoder.com\/reveal\/wp-json\/wp\/v2\/tags?post=113"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}