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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:46:56+00:00 2026-05-29T23:46:56+00:00

This is working fine right now. The infowindow is just too big and ugly.

  • 0

This is working fine right now. The infowindow is just too big and ugly. I want to implement infobox as it is more customizable. Can someone guide me on how i use infobox object to create the popup marker window?

var map,geocoder;
var bound = new google.maps.LatLngBounds();
function initializeMap() {
    geocoder = new google.maps.Geocoder();
    var latlng = new google.maps.LatLng(39.88445,-86.11084);
    var myOptions = {
    maxZoom: 14,
    mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    map = new google.maps.Map(document.getElementById("map_canvas"),
        myOptions);
}
function codeAddress() {
    var infowindow = new google.maps.InfoWindow({}); 
    $('.eachLocation').each(function(index) {
        var counter=index+1;
        var addy = $(this).parent().find('span.LocAddHidden').text();
        geocoder.geocode( { 'address': addy}, function(results, status) {
            if (status == google.maps.GeocoderStatus.OK) 
            {
                map.setCenter(results[0].geometry.location);
                var marker = new google.maps.Marker({
                    position: results[0].geometry.location,
                    map: map,               
                    title:addy,
                  });   
                //Adding a click event to the marker 
                google.maps.event.addListener(marker, 'click', function() { 
                    infowindow.setContent('<div id=\"infowindow\" style="width:235px; height:105px;>'
                                        +'Hello World'+'</div>'); 
                    infowindow.open(map, this); 
                 });
                bound.extend(marker.getPosition());
                map.fitBounds(bound);
            } 
        });//geocode END
        counter=counter+1;
    });
}
  • 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-29T23:46:57+00:00Added an answer on May 29, 2026 at 11:46 pm

    You have to read this example provided by Google :
    http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/docs/examples.html

    You’ll find the basic source code here : view-source:http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/examples/infobox-basic.html

    You need to add this plugin to your page : http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/src/infobox.js

    Then, you could be able to run some infobox instead of infowindow, with something like that in your case :

    function codeAddress() {
        var infoboxOptions = {
                 content: ''
                ,disableAutoPan: false
                ,maxWidth: 0
                ,pixelOffset: new google.maps.Size(0, 0)
                ,zIndex: null
                ,boxStyle: { 
                  background:''
                  ,opacity: 0.75
                 }
                ,closeBoxMargin: "2px 2px 2px 2px"
                ,closeBoxURL: "http://www.google.com/intl/en_us/mapfiles/close.gif"
                ,infoBoxClearance: new google.maps.Size(1,1)
                ,isHidden: false
                ,pane: "floatPane"
                ,enableEventPropagation: false
            };  
        var ib = new InfoBox(infoboxOptions); 
        $('.eachLocation').each(function(index) {
            var counter=index+1;
            var addy = $(this).parent().find('span.LocAddHidden').text();
            geocoder.geocode( { 'address': addy}, function(results, status) {
                if (status == google.maps.GeocoderStatus.OK) 
                {
                    map.setCenter(results[0].geometry.location);
                    var marker = new google.maps.Marker({
                        position: results[0].geometry.location,
                        map: map,               
                        title:addy,
                        html:  'Your HTML/text...'
                      });   
                    //Adding a click event to the marker 
                    google.maps.event.addListener(marker, 'click', function() { 
                        ib.setContent(marker.html);
                        ib.open(map,this);  
                     });
                    bound.extend(marker.getPosition());
                    map.fitBounds(bound);
                } 
            });//geocode END
            counter=counter+1;
        });
    }
    

    In my case, to have a nice div with my own css, I use, in the marker :

    html:$(this).html()

    Which gets the content of each ‘.myClass’ (.eachLocation in your case)

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

Sidebar

Related Questions

So I had this working perfectly fine, but now for some reason I can't
Right now I have one bean with a @Scheduled method working fine; it's declared
I'm trying to add subviews to a UIButton . This is working fine right
Can you explain me how thread is working. Actually it's working just fine right
Right now i am consuming a SOAP web service on android/eclipse.Well its working fine.Please
This is working fine in Firefox and IE, but I can't get this to
This is working fine in core php, but not in magento. $party_payment = new
I am recrusively evaluating properties via reflection using object.GetType().GetProperty(string propertyName). This is working fine
I am using RijndaelManaged to make a simple encryption/decryption utility. This is working fine,
I send email through Outlook using VB.Net 2005; this is working fine. At the

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.