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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T10:35:52+00:00 2026-06-16T10:35:52+00:00

I use google Maps Api v3 to render google map inside colorbox using ajax

  • 0

I use google Maps Api v3 to render google map inside colorbox using ajax call.

This is div that i use as container for map and some other things, and that one will be displayed in colorbox, also anchor on witch click ajax will be called:

<div id="cb-js-map-content" style="display: none"></div>
<a href="#cb-js-map-content" id="cb-js-showMap">
   Show Map
</a>

I use ajax to retrieve document in witch is map markup and js function that will generate map. This is ajax call and colorbox init:

FSM.mapAjaxCall = {
            GetMap: function () {
                $("#cb-js-showMap").click(function () {

                    $.ajax({
                        url: //my ajax url
                        cache: false,
                        dataType: 'json',
                        success: function (data, status) {
                            var target = $("#cb-js-map-content");
                            target.append(data.Html);
                            if (typeof (data.Javascript) === "undefined") {
                                return;
                            }
                            $.loadScript(data.Javascript);
                        }
                    });
                     $("#cb-js-map-content").show();

                    $("#cb-js-showMap").colorbox({
                        inline: true,
                        height: colorboxHeight,
                        width: colorboxWidth,
                        onClosed: function () {
                           $("#cb-js-map-content").hide();
                        }

                    });
                });
            }
        };

This is div where map will be loaded

<div class="inlineClass" id="cb-js-mainMap" style="width:1023px; height: 800px; display:block"></div>

using this js function:

initializeMap = function () {
                var mapOptions = {
                    center: centerLatlng,
                    zoom: 8,
                    minZoom: 10,
                    mapTypeId: google.maps.MapTypeId.ROADMAP,
                    scrollwheel: false
                };
                map = new google.maps.Map(document.getElementById("cb-js-mainMap"), mapOptions);

                //Add event for zoom changed and store data for map center
                google.maps.event.addListener(map, 'zoom_changed', function () {
                   //listener code
                });
                google.maps.event.trigger(map, 'resize');

            }

Now my problem is that this setting works almost always on firefox, and sparsely in Chrome. This is how problematic screen looks like:
enter image description here

Closing colorbox popup sometimes resolve this issue.

  • 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-16T10:35:53+00:00Added an answer on June 16, 2026 at 10:35 am

    Trigger the resize-event in the success-callback of $.ajax()

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

Sidebar

Related Questions

I had the following HTML page rendering to use the Google Maps API. This
I am using GWT for google map application. I use Google's gwt-maps.jar for mapping
How can I use Google Maps API to show me a full screen map
I want to develop an IOS app, that will use Google Maps JavaScript API
On my page, there is a container which use Google Maps API to display
I use google maps API to display markers on a map. Each marker points
I use the Google Maps API (v.3) to show a map with a couple
I'd like to use Google maps static API to display a map with a
I'm learning the Google Maps API and I was wondering whether I can use
Borrowing this code from several different tutorials on how to use Google maps on

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.