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

  • Home
  • SEARCH
  • 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 6972031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:54:57+00:00 2026-05-27T16:54:57+00:00

I have a google map set with the Javascript API V3. It’s displayed in

  • 0

I have a google map set with the Javascript API V3. It’s displayed in a div with a dynamic width, as a content pane slides up when we click on a marker.

Everything works fine, but one thing: When the pane slides up, the width of the map is changed, and so the center is displaced to the right (the pane is on the left). It is really inconvienient especially for small resolutions, where you can’t even see the center after the pane is open.

I’ve tried the ‘resize’ trigger, but it doesn’t seem to work… Any ideas ?

Thanks a lot !

  • 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-05-27T16:54:57+00:00Added an answer on May 27, 2026 at 4:54 pm

    Calling resize by it self will not acheive what you need.

    What you need to do is first (before a resize occurs) get the current center of the map

    var currCenter = map.getCenter();
    

    Then you need to do something like the following, after your div is resized.

    google.maps.event.trigger(map, 'resize');
    map.setCenter(currCenter);
    

    Should do the trick

    UPDATE 2018-05-22

    With a new renderer release in version 3.32 of Maps JavaScript API the resize event is no longer a part of Map class.

    The documentation states

    When the map is resized, the map center is fixed

    • The full-screen control now preserves center.

    • There is no longer any need to trigger the resize event manually.

    source: https://developers.google.com/maps/documentation/javascript/new-renderer

    google.maps.event.trigger(map, "resize"); doesn’t have any effect starting from version 3.32

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

Sidebar

Related Questions

I have a scenario where I am using Google Map JavaScript API to process
I have a dynamic map in Google Maps (API v2) I want to overlay
I have a Google Map (API 3) in a hidden div when my page
using javascript google-maps api I currently have it setup to remove a maker I
I've looked at Google's map API, which is all javascript and terribly slow on
I'm using google.maps javascript API v3. I need to translate a set of civic
I have a google maps app that will resize the map div if its
I have a google map set up with markers supplied via a JSON feed.
Right now I have google map code that will set a single marker on
I'm using the Google Maps Javascript API and I have LatLng coordinates that are

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.