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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:45:17+00:00 2026-05-26T03:45:17+00:00

Is it possible to load the content (i.e. the HTML displayed in the tooltip)

  • 0

Is it possible to load the content (i.e. the HTML displayed in the “tooltip”) of a Google Map marker only when the user actually clicks it?

I have a nice Google Map embedded on our site, and it works fine – with just 200 markers at a time. But now we would like to show a substantial number of marker(3900+), and currently all the tiny HTML pages for displaying the tooltips are set when the markers are added. Ideally, this HTML would be loaded using AJAX.

  • 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-26T03:45:17+00:00Added an answer on May 26, 2026 at 3:45 am

    Yes, you will need to load the data you wish when a marker you have added to the map is clicked, by adding a click listener to the marker.

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
    <script src="https://maps.googleapis.com/maps/api/js?v=3&sensor=true_or_false"
    type="text/javascript"></script>
    
    <div id="map_canvas"> </div>
    
    <script>
         var myLatlng = new google.maps.LatLng(-25.363882,131.044922);
          var myOptions = {
            zoom: 4,
            center: myLatlng,
            mapTypeId: google.maps.MapTypeId.ROADMAP
          }
          map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
    
    
          var marker = new google.maps.Marker({
              position: myLatlng, 
              map: map,
              title:"Hello World!"
          });
          google.maps.event.addListener(marker, 'click', function() {
    
          // When clicked on the marker I use jquery to request some Html 
          // then show in the contents of an info window
            $.ajax({ 
               url: 'http://www.test.com/get-data/',
               dataType: 'html',
               success: function (data) {
                   var infowindow = new google.maps.InfoWindow(
                    { content: data,
                   size: new google.maps.Size(50,50),
                   position: marker.position
                  });
                infowindow.open(map);
               }
    
            });
    
          });
    
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to load an html document into a DOM javascript object so
Is it possible to load an html document using ajax and then perform a
I wonder if it's possible to load jQuery within Opera User JavaScript , so
Is it possible to load an external HTML file into a variable and then
Possible Duplicate: How to put this code in v3 instead v2 map I have
I have a code <div id=content></div> I load into this content my Ajax content
Possible Duplicate: load content from external page into another page using ajax/query May be
I have a website that displays some partial html content in fancybox. In all
Is it possible to load child entities in a single query without using DataLoadOptions?
Is it possible to load a URL in a WebView and resize it to

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.