Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8448991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:34:39+00:00 2026-06-10T10:34:39+00:00

I am trying to get google maps api v3 to work, and well, it

  • 0

I am trying to get google maps api v3 to work, and well, it does! but ONLY when I set the div that displays the map to have an id of “map_canvas”. Is that Id required? What if you want to display multiple maps on one page?

I am setting the id in BOTH my js and html markup

It works flawlessly like this:

JS

<script type="text/javascript" >
 function initialize() {
    var mapOptions = {
     center: new google.maps.LatLng(-34.397, 150.644),
      zoom: 8,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
 }
</script>

HTML

 <div style="width:300px; height:300px;">
  <div style="width:100% height:100%" id="map_canvas"></div>
 </div>

It loads the map according to firebug, but doesn’t display anything when I do this:

JS

<script type="text/javascript" >
 function initialize() {
    var mapOptions = {
     center: new google.maps.LatLng(-34.397, 150.644),
      zoom: 8,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    var map = new google.maps.Map(document.getElementById("anyotherid"), mapOptions);
 }
</script>

HTML

 <div style="width:300px; height:300px;">
  <div style="width:100% height:100%" id="anyotherid"></div>
 </div>

Update

I uploaded an example page that reporduces my problem at:
Example at athleticaustin.com/spots/test

One peculiarity that I have noticed is that when I edit the id attribute with firebug from map_test to map_canvas on the div that displays the map, it suddenly appears even though the id is still defined as map_test in the JS in the head.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T10:34:40+00:00Added an answer on June 10, 2026 at 10:34 am

    There is a semicolon missing in

    <div style="width:100% height:100%" id="anyotherid"></div>
    

    it should be

    <div style="width:100%; height:100%" id="anyotherid"></div>
    

    (semicolon after width:100%;), but that semicolon is also missing in your map_canvas snippet, so it is probably not the issue, unless you copy/paste’d wrongly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to get started with the Google Maps API, but I'm finding
I'm trying to get mouseover to work polygons in google maps api v3. I've
I'm trying to get my hands dirty on Google Maps API v3. But now
I've been trying to get a certain Google API to work for two days
I'm trying to get an overlay in google maps api v3 to appear above
I am trying to get a google API key to add google maps to
I'm trying to get the google maps for websites API working on my php
I am trying to do a google maps activity but I get a LogCat
I am trying to get into the google maps api v3 to display store
Am trying to use google.loader.ClientLocation along with the maps api to get the location

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.