WordPress.org

Forums

Adding Google Map to page template (2 posts)

  1. mmadden
    Member
    Posted 1 year ago #

    I'm in the process of moving my first static html site over to wordpress. So far everything has gone as expected with the exception of the google maps I had coded into two of my pages. I'm working on wamp and the maps are running fine there, but on the template, the map won't load and I get the following in the console...

    The Google Maps API server rejected your request. This site or IP is not authorized to use this API key.

    I know it can't be the key since it's working just a few levels up. It seems like the most popular method of including maps to a page is to put them in a post and then call for the post where you want the map to appear, but since the map the map is likely to never change, I would rather code it directly into the template instead of adding it dynamically. Any suggestions would be helpful. Thanks in advance!

  2. mmadden
    Member
    Posted 1 year ago #

    Here is the code for the static map I'm trying to load. Nothing special. I also had the JavaScript version on top of this. I feel like if I can get this one running, then the other should be no problem.

    <img src="http://maps.googleapis.com/maps/api/staticmap?key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&sensor=false&size=300x300&markers=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" alt="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"></img>

Topic Closed

This topic has been closed to new replies.

About this Topic