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 8139263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:46:08+00:00 2026-06-06T11:46:08+00:00

I installed the Google Maps API V3, but I’m having trouble getting the resize

  • 0

I installed the Google Maps API V3, but I’m having trouble getting the resize function to work properly. I’ve put the script to display the map in a division that drops down when a link is clicked, however, it shows gray areas on the sides. I’ve read instances where you have to have the resize function in the script that displays the division, from what I can understand, but I’m having trouble implementing it properly.

enter image description here

Here’s the code that causes the division (class=”content”) to be revealed:

    $(function() {
$('.action').click(function() {          
    var name = $(this).attr("name");
    var content = $('.content[name=' + name + ']');
    $('.content').not(content).hide('fast');
    content.slideToggle('fast');
});

I have the map inside of a div with the id “map”.

  <div class="map">
      <div id="map_canvas""></div>
  </div>

I’ve been up all night working on other portions of the site and am fairly scatterbrained at the moment. sorry if I forgot to post something necessary to resolve this.

Thanks in advance, Bc.

  • 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-06T11:46:09+00:00Added an answer on June 6, 2026 at 11:46 am

    You need to manually throw the even resize on the google map.

    google.maps.event.trigger(map, 'resize')
    

    Reference.

    Update

    <script type="text/javascript"> 
    // Global Variable
    var map;
    
    // This is a global Function
    function initialize() 
    { 
      // This variable is scoped only for the initialize function,
      // it is not available to other functions scoped globally
      var myOptions = 
      { 
        center: new google.maps.LatLng(-34.397, 150.644), 
        zoom: 8, 
        mapTypeId: google.maps.MapTypeId.ROADMAP 
      };
    
      // Instead of a function scoped map variable this should be global
      map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
    
      google.maps.event.trigger(map, 'resize') 
    } 
    </script>
    

    Then you can change to the following code:

    $(function() 
    {
      $('.action').click(function() 
      {          
        var name = $(this).attr("name");
        var content = $('.content[name=' + name + ']');
        $('.content').not(content).hide('fast');
        // this uses the callback functionality
        // to only throw the trigger after the
        // animation finishes.
        content.slideToggle('fast',
          function() 
          {
            google.maps.event.trigger(map, 'resize');
          });
      });
    });
    

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

Sidebar

Related Questions

My application's function about Google Maps doesn't work, the map only displays a grid
I've installed the Google Maps Java 2 ME app on my Nokia N73 which
I have installed google test as it'is described here . But when I try
I've installed the Google Plugin for Eclipse 3.4 and it seems to work fine.
This may be a stupid question, but here it goes. Is Google Maps a
I have installed the sweet Google-Maps-for-Rails plugin, which seems to be under active development.
I have gaming commmunity forum, where i installed some Google Ads, but people are
I'm currently working on something using the Buzz API, and I've installed the Google
Possible Duplicate: How to detect an android device whether it supports google maps API
I'm trying to use google maps in my wpf c# project, I've installed Adobe

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.