Question

Use Google API to develop a webpage that shows the map of a certain Postal Office...

Use Google API to develop a webpage that shows the map of a certain Postal Office Location of your choice. The webpage should also display address information about the Postal Office and the exact post office location should be visible when the webpage is open without the need of zooming in

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. Get the API key

You must have at least one API key associated with your project.

To get an API key:

1. Go to the Google Cloud Platform Console: https://cloud.google.com/console/google/maps-apis/overview
2. Click the project drop-down and select or create the project for which you want to add an API key.
3. Click the menu button and select APIs & Services > Credentials.
4. On the Credentials page, click Create credentials > API key.
The API key created dialog displays your newly created API key.
   6. Click Close.
The new API key is listed on the Credentials page under API keys.
(Remember to restrict the API key before using it in production.)

2. Get the latitude and longitude of a given location:

function GEOCODE_GOOGLE(address) {
if (address.map) {
return address.map(GEOCODE_GOOGLE)
} else {
var r = Maps.newGeocoder().geocode(address)
for (var i = 0; i < r.results.length; i++) {
var res = r.results[i]
return res.geometry.location.lat + ", " + res.geometry.location.lng
}
}
}

3. Add the API key to your web page:

Use the latitude and longitude from above function (step 2) into your web page.

<html>
<body>
<div id='map'></div>
<script>
   function initmap(float latitude, float longitude){
       var location = {lat: latitude, lng: longitude }
       var map = new google.maps.Map(document.getElementById("map"), {
       zoom: 4,
       center: location
       })
       }
</script>

<script async defer
src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap"
type="text/javascript">
</script>
</body>
</html>

Hope the above code will be useful for you.

Thanks,

Add a comment
Know the answer?
Add Answer to:
Use Google API to develop a webpage that shows the map of a certain Postal Office...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Question - What's next for Google? Is the company right to put so much focus on...

    Question - What's next for Google? Is the company right to put so much focus on Mobile? GOOGLE In 1998, two Stanford University PhD students, Larry Page and Sergey Brin, founded a search engine company and named it Google. The name plays on the number googol-1 followed by 100 zeroes—and refers to the massive quantity of data available online that the company helps users find. Google's corporate mission is "To organize the world's information and make it universally accessible and...

  • Develop a set of classes for a college to use in various student service and personnel applications. Classes you need to design include the following: • Person — A Person contains the following fields...

    Develop a set of classes for a college to use in various student service and personnel applications. Classes you need to design include the following: • Person — A Person contains the following fields, all of type String: firstName, lastName, address, zip, phone. The class also includes a method named setData() that sets each data field by prompting the user for each value and a display method that displays all of a Person’s information on a single line at the...

  • You are a database consultant with Ace Software, Inc., and have been assigned to develop a...

    You are a database consultant with Ace Software, Inc., and have been assigned to develop a database for the Mom and Pop Johnson video store in town. Mom and Pop have been keeping their records of videos and DVDs purchased from distributors and rented to customers in stacks of invoices and piles of rental forms for years. They have finally decided to automate their record keeping with a relational database. You sit down with Mom and Pop to discuss their...

  • For your Project, you will develop a simple battleship game. Battleship is a guessing game for...

    For your Project, you will develop a simple battleship game. Battleship is a guessing game for two players. It is played on four grids. Two grids (one for each player) are used to mark each players' fleets of ships (including battleships). The locations of the fleet (these first two grids) are concealed from the other player so that they do not know the locations of the opponent’s ships. Players alternate turns by ‘firing torpedoes’ at the other player's ships. The...

  • Requirements Create an Address Book class in Java for general use with the following behaviors: 1....

    Requirements Create an Address Book class in Java for general use with the following behaviors: 1. Constructor: public Address Book Construct a new address book object. • A contact has four fields: first name, last name, email and phone. (There could be more information for a real contact. But these are sufficient for the assignment.) . The constructor reads from the disk to retrieve previously entered contacts. If previous contacts exist, the address book will be populated with those contacts...

  • You will develop an E-Commerce database used to maintain customers, products and sales information. You are...

    You will develop an E-Commerce database used to maintain customers, products and sales information. You are required to 1) gather and analyze requirements 2) design logical structure of the database 3) create stored procedures to develop the tables and insert the data 4) write SQL statements for data extraction and reporting. Throughout the course of this semester you have analyzed the requirements for an eCommerce database, designed and developed your database. As a class we have gone through the process...

  • Your project will require you to develop a database design to solve a real-life data management...

    Your project will require you to develop a database design to solve a real-life data management problem. It can be any problem in your work environment or for another organization, for example, a bookstore (think of how Amazon uses databases), a course management system (think of how a university manages courses), a bank (think of how your bank works), and an online auction site (think of how Ebay works). You will develop a database to solve this problem You will...

  • Please write c++ (windows) in simple way and show all the steps with the required output

    please write c++ (windows) in simple way and show all the steps with the required output Write a C++ program that simulates the operation of a simple online banking system The program starts by displaying its main menu as shown in Figure1 splay Account nformatson verity Your credit Card elect vour choice Figure 1 Main menu of the program The menu is composed of the following choices 1. When choice 1 is selected (Display Account information), the program should display...

  • please use dia to draw the e-r diagram to create Entity - Relationship Diagrams then use MS access This project requires you to create a database design. Your design will be documented in a set o...

    please use dia to draw the e-r diagram to create Entity - Relationship Diagrams then use MS access This project requires you to create a database design. Your design will be documented in a set of Entity-Relationship Crow's Foot diagrams using the representation as shown in the lecture materials. Draw a set of Entity-Relationship diagrams to model the following scenario. The Maggs Realty Company wants to track the Sales Offices that they have across all of Ontario They are interested...

  • please help!! hoose a Tool to Design Your Wireframes You may use any tool available to...

    please help!! hoose a Tool to Design Your Wireframes You may use any tool available to you that will allow you to create simple skeletal sketches of each screen or page, and to label the location of the key elements described in Part B of the assignment. You should save the sketches in one of the following formats: docx, .pptx, .sketch, .psd, .pdf, .png, .jpg, .gif, .png, or .rtf. Possible tools include Paint, PowerPoint, Word, Adobe Illustrator, Visual Studio, Visio,...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT