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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:23:04+00:00 2026-05-23T04:23:04+00:00

I use a simple Google Maps API on a simple webpage. The map contains

  • 0

I use a simple Google Maps API on a simple webpage. The map contains a few custom icons and an infoWindow is set up. When opening the infoWindow/bubble by clicking on an icon the map does not do autopan and clicking on the X on the info bubble does not close it.

I am using JQuery but did the test without it and it still did not work.
After clicking an icon and looking at the Firebug console I see the following error message:

b.O is not a function

(75 out of range 42)

I have set up a jsFiddle test case for this but I am also including the code here (the JavaScript is in the body because the code is part of a control).

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
    <script type="text/javascript">
        function GetMapBubbleContent(id) {
            return 'content';
        }

        var infowindow = new google.maps.InfoWindow();
        var map_plants;

        function InitializeMap() {
            var imagesPath = 'http://lh6.ggpht.com/eib8rqN0V8k1Jhnu56cqubkvaEPf_6BXgyEqBPUCj9mHo57xXpMZAMUqr6SPj5b3cUQrqnoNc4Ct3Ps0zRg=s36';
            var image = new google.maps.MarkerImage(imagesPath, new google.maps.Size(36, 36), new google.maps.Point(0, 0), new google.maps.Point(0, 36));
            var shadow = new google.maps.MarkerImage(imagesPath, new google.maps.Size(55, 45), new google.maps.Point(0, 0), new google.maps.Point(0, 45));
            var shape = {
                coord: [0, 0, 36, 0, 36, 36, 0, 36],
                type: 'poly'
            };
            var image_own = new google.maps.MarkerImage(imagesPath, new google.maps.Size(36, 36), new google.maps.Point(0, 0), new google.maps.Point(0, 36));

            var image_small = new google.maps.MarkerImage(imagesPath, new google.maps.Size(20, 20), new google.maps.Point(0, 0), new google.maps.Point(0, 20));
            var shadow_small = new google.maps.MarkerImage(imagesPath, new google.maps.Size(30, 25), new google.maps.Point(0, 0), new google.maps.Point(0, 25));
            var shape_small = {
                coord: [0, 0, 20, 0, 20, 20, 0, 20],
                type: 'poly'
            };
            var image_small_own = new google.maps.MarkerImage(imagesPath, new google.maps.Size(20, 20), new google.maps.Point(0, 0), new google.maps.Point(0, 20));
            var latlng = new google.maps.LatLng(46.239343, 5.399111);

            var myOptions = {
                zoom: 6,
                center: latlng,
                mapTypeId: google.maps.MapTypeId.HYBRID,
                pancontrol: false,
                zoomcontrol: true,
                scalecontrol: true
            };

            infowindow = new google.maps.InfoWindow();
            map_plants = new google.maps.Map(document.getElementById("panelMap"), myOptions);

            var mrk0 = new google.maps.Marker({
                position: new google.maps.LatLng(48.183909, 10.977222),
                icon: image_own,
                shape: shape,
                shadow: shadow,
                title: 'Test1',
                map: map_plants
            });
            google.maps.event.addListener(mrk0, 'click', function () {
                infowindow.close();
                infowindow.setContent(GetMapBubbleContent(1218));
                infowindow.open(1218, mrk0);
            });
            var mrk1 = new google.maps.Marker({
                position: new google.maps.LatLng(45.574806, 11.834682),
                icon: image_own,
                shape: shape,
                shadow: shadow,
                title: 'Test2',
                map: map_plants
            });
            google.maps.event.addListener(mrk1, 'click', function () {
                infowindow.close();
                infowindow.setContent(GetMapBubbleContent(1131));
                infowindow.open(1131, mrk1);
            });
            var mrk2 = new google.maps.Marker({
                position: new google.maps.LatLng(48.976219, 16.977306),
                icon: image_own,
                shape: shape,
                shadow: shadow,
                title: 'Test3',
                map: map_plants
            });
            google.maps.event.addListener(mrk2, 'click', function () {
                infowindow.close();
                infowindow.setContent(GetMapBubbleContent(911));
                infowindow.open(911, mrk2);
            });
            var mrk3 = new google.maps.Marker({
                position: new google.maps.LatLng(1.000000, 15.000000),
                icon: image_own,
                shape: shape,
                shadow: shadow,
                title: 'Test4',
                map: map_plants
            });
            google.maps.event.addListener(mrk3, 'click', function () {
                infowindow.close();
                infowindow.setContent(GetMapBubbleContent(1422));
                infowindow.open(1422, mrk3);
            });
            var mrk4 = new google.maps.Marker({
                position: new google.maps.LatLng(48.055114, 9.052830),
                icon: image_own,
                shape: shape,
                shadow: shadow,
                title: 'Test5',
                map: map_plants
            });
            google.maps.event.addListener(mrk4, 'click', function () {
                infowindow.close();
                infowindow.setContent(GetMapBubbleContent(687));
                infowindow.open(687, mrk4);
            });
        }

        $(document).ready(function () {
            InitializeMap();
        });
    </script>
    <div id="panelMap" style="height: 600px; width: 600px; overflow: hidden;">
</body>
</html>
  • 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-23T04:23:05+00:00Added an answer on May 23, 2026 at 4:23 am

    It appears your event listeners are incorrect..

        google.maps.event.addListener(mrk1, 'click', function() {
        infowindow.close();
        infowindow.setContent(GetMapBubbleContent(1131));
        infowindow.open(1131, mrk1);
    });
    

    The infowindow open line should be:

    infowindow.open(map_plants, mrk1);
    

    Open takes as param the map and then the mark so this worked for me in your fiddle.

    Working fiddle update here.

    EDIT: Also, upvote for a well thought out, detailed example where we see you’ve done the work.

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

Sidebar

Related Questions

GOOGLE MAPS API V3 is what i'm trying to use. I have all the
I would normally use Google analytics because it is free and simple to implement
Fairly new to Google Maps API. I've got an array of data that I
I have a city map of Moscow. We modified a Google Maps image with
I want to add a google map(with street view) in my site. I use
We use a simple object model for our low level networking code at work
I want to use the php simple HTML DOM parser to grab the image,
I'm looking for something simple to use where the grammar is easy to define.
I'm looking for good/working/simple to use PHP code for parsing raw email into parts.
My use case is very simple : I have a GUI application, and inside

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.