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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:34:47+00:00 2026-06-17T03:34:47+00:00

Hi i have an web app where i integrate gmap on it which will

  • 0

Hi i have an web app where i integrate gmap on it which will look similar to Yelp gmap services. The issues is that when i mouseover the marker the infobox stuck within the box as follow:

enter image description here

the infobox suppose to look like this

enter image description here

Below are my current code for integrate gmap

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/src/infobox_packed.js"></script>

<script type="text/javascript">

    var gmap, gpoints = [];

    $(document).ready(function() {
        initialize();
    });

function initialize() {

        gmap = new google.maps.Map(document.getElementById('themap'), {
            zoom:               8,
            streetViewControl:  false,
            scaleControl:       false,
            center:             new google.maps.LatLng(3.3000000,101.9629796),
            mapTypeId:          google.maps.MapTypeId.ROADMAP
        });
 <?php
$content = '<p>Test</p>'; 
?>
 gpoints.push( new point(gmap, '<?php echo $lat; ?>', '<?php echo $long; ?>', '<?php echo $content; ?>') );
}

 function point(_map, lat, lng, content) {
        this.marker = new google.maps.Marker({
            position:           new google.maps.LatLng(lat,lng),
            map:                _map,
            zIndex: 11
        });
this.content = content;



        var gpoint = this;


        google.maps.event.addListener(gpoint.marker, 'mouseover', function() {
            popup(gpoint);
        });

google.maps.event.addListener(_map, 'zoom_changed', function() {
            center=gpoint.marker.getPosition();
            lat=center.lat();
            lng=center.lng();
           // alert(lat+"===="+lng);
        });    
}

 function popup(_point) {
        _point.popup = new InfoBox({
            content: _point.content,
            position:  _point.marker.getPosition(),
           // shadowStyle: 1,
            padding: 20,
            //backgroundColor: '#ddd',
            borderRadius: 10,
            arrowSize: 10,
            borderWidth: 1,
           // borderColor: '#dddddd',
            disableAutoPan: true,
            arrowPosition: 30,
           // backgroundClassName: 'phoney',
            arrowStyle: 2


        });

_point.popup.open(_point.marker.map, _point.marker);

        google.maps.event.addListener(_point.popup, 'domready', function() {                    
            google.maps.event.addDomListener(_point.marker, 'mouseout', function() {
                _point.popup.close();
            });
        });

}

</script>
  • 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-17T03:34:48+00:00Added an answer on June 17, 2026 at 3:34 am

    You may use the option pixelOffset of the infoBox to control the position related to the marker.

    The default is 0,0 , which means that the top left corner of the infoBox sticks on the position(of the marker).

    To place it top+center, you must explicitly assign to the content of the infobox, and apply a pixelOffset as follows:

    pixelOffset:new google.maps.Size(-halfOfWidthOfTheBox,0)
    

    When you don’t know the size of the infoBox you may calculate it.
    Add this to the domready-callback of _point.popup:

    this.setOptions({pixelOffset:new google.maps
                                 .Size(-parseInt(this.div_.offsetWidth/2,10),0)});
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a customer service web app requirement, which requires that I work pull
I have to integrate a payment gateway in my web app. I am negotiating
I have a web-app with a Java back-end that uses Tomcat jdbc-pool for database
I have a web app that runs fine in Visual web developer. But when
I have another web app, that uses the liferay user database. But before a
I have a web app that reads data from a SQL DB that contains
I have a web app that has a big and complex form (fields, checks,
I have a website that uses Amazon Web Services(AWS) infrastructure. I wrote the entire
I have developed a web app in ASP.NET MVC which we are using internally.
We have a web app (let's call it widget app) that contains data I

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.