Avatar of Camillia
Camillia
Flag for United States of America asked on

Following an example - How do I change google map location?

My boss bought a website template that comes with google map. The location is set to New York. We want to change it to St. Louis, MO.

I don't have the code ... my boss has it. He was plugging in some values, refreshing the page and the location was still showing New York

but I've been looking at some tutorials and examples and came across this.

http://www.w3schools.com/googleapi/google_maps_basic.asp

How do I get the longitude and latitude for a location? Do I need to get an key as well?
ASP.NETC#.NET Programming

Avatar of undefined
Last Comment
Camillia

8/22/2022 - Mon
Eric C

The website template you purchased - is itan html template or a wordpress template? (or something else)?

If it's a wordpress template, most likely there is a page in the wp admin (in the theme's settings page) that allows you to enter in your address, and the API will automatically render the correct map)

If it's an html template, you'll need to look at the source and see what it's doing.

I've seen some html templates where the map is just hard-coded. Meaning they are only there to show how the page would look with a google map, but it's up to you to add the code to get it to work.

I've seen other html templates where the google map is displayed in an iframe. Look at the source code of the page, look for an iframe that includes 'maps.google.com' followed by a long string of code. That is the address. To find your address, open up a new browser window, go go https://maps.google.com and enter in your exact address and press the Enter key. Once the map is displayed, zoom in our out as you prefer and then look for the icon to show the embed code for the map as  you see it on the page.  Copy the code and then carefully paste it into our html file.

The google documentation will tell you how the google maps API works - but *how* it is implemented in the template you bought - that all depends on the author of the theme.  If you purchased the template from themeforest or template monster, both offer support. Since many other people probably bought that template as well, chances are good they have documentation for updating the map.
Camillia

ASKER
It's HTML and my boss got it from template monster.

To find your address, open up a new browser window, go go https://maps.google.com and enter in your exact address and press the Enter key. Once the map is displayed, zoom in our out as you prefer and then look for the icon to show the embed code for the map as  you see it on the page.  Copy the code and then carefully paste it into our html file.

I type in the address. See the icon on the address but where's the code to copy??
Eric C

open up the html file you purchased from template monster.  You need to know the name of the file that contains the google map.  For example, if it's a one-page scrolling website, it might be index.html, or if it's a separate page it might be called 'contact.html'.

Open that file in Dreamweaver, a plain text editor or your favorite code editor. Search for the string 'maps.google.com' and see what you find.

The FIRST step is to locate the EXISTING code in the template monster file. Let me know if you find that.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Camillia

ASKER
I'll take a look in the morning when I go to work. We opened it in VS 2015. I saw some code with coordinates that was in New York. We just need it to point to another location.

I'll check it in the morning again.

Just don't know where the embeded code that you refer to is.
ASKER CERTIFIED SOLUTION
Eric C

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Camillia

ASKER
Thanks, Eric. I'll try this in the morning and post back.