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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:12:59+00:00 2026-06-09T15:12:59+00:00

I have been reading the many similar threads and cannot see how to make

  • 0

I have been reading the many similar threads and cannot see how to make this work in my code… any advice would be appreciated.

I have numerous markers set via AJAX and I create a table below my map from data returned in the JSON results. I want to make a link clickable in my datatable that will emulate a click on the corresponding marker on the map and open the info window already defined for an actual click on the marker…

function display( json_results ) {

        $("#map").gmap3({action:'clear'});

        $("#map").gmap3(
            {action: 'init',
              options:{
                center:true,
                zoom:13,
                mapTypeId: google.maps.MapTypeId.ROADMAP,
                mapTypeControl: true,
                mapTypeControlOptions: {
                        style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
                },
                navigationControl: true,
                scrollwheel: true,
                streetViewControl: true
                }
            },
            {action: 'addMarkers',
                radius:100,
                markers: json_results,
                clusters:{
                            maxZoom: 10,
                            // This style will be used for clusters with more than 0 markers
                            20: {
                            content: '<div class="cluster cluster-1">CLUSTER_COUNT</div>',
                            width: 53,
                            height: 52
                            },
                            // This style will be used for clusters with more than 20 markers
                            50: {
                            content: '<div class="cluster cluster-2">CLUSTER_COUNT</div>',
                            width: 56,
                            height: 55
                            },
                            // This style will be used for clusters with more than 50 markers
                            100: {
                            content: '<div class="cluster cluster-3">CLUSTER_COUNT</div>',
                            width: 66,
                            height: 65
                            }

                    },
                marker: {
                    options: {
                        //icon: new google.maps.MarkerImage('http://maps.gstatic.com/mapfiles/icon_green.png'),
                        clickable: true
                        },
                    events:{
                        click: function(marker,event,data) {
                            $(this).gmap3({action: 'clear', name : 'infowindow'});
                            $(this).gmap3({action: 'addinfowindow', anchor: marker, options: { content:
                            '<div class="text"><strong><div style="color:navy;">' + data.itype + '</strong><br/><div id="address" snum="' + data.streetnum + '" snam="' + data.streetnam + '" styp="' + data.streettyp + '">'+ data.iaddress +'</div><br/>' + data.inum + '<br/>'+ data.datetime +'</div><hr>'+data.notes+'</div>'} })
                        },  
                        mouseover: function(marker, event, data){
                            $(this).gmap3(
                                { action:'clear', name:'overlay'},
                                { action:'addOverlay',
                                    latLng: marker.getPosition(),
                                    content:    '<div class="infobulle">' +
                                                '<div class="bg"></div>' +
                                                '<div class="text">' + data.itype +'</div>' +
                                                '</div>' +
                                                '<div class="arrow"></div>',
                                    offset: {
                                        x:-46,
                                        y:-73
                                    }
                                });
                        },
                        mouseout: function(){
                            $(this).gmap3({action:'clear', name:'overlay'});
                            }

                    } //end events
                } // end marker

                }
                ,{action:"autofit"} //end action

                );
            };

I call this function from some JQUERY when the page is loaded and when a form with search results gets submitted. All works perfectly. Now I want to add a link outside the map that will trigger the click on the corresponding marker…

For example: <a href="javascript:google.maps.event.trigger(markers[i], "click")">See This Infowindow</a> where i would be a value that I pass in my JSON at the same time I pass the lat/long and infowindow data to the function above. I assume that the 1st array of data to get sent for mapping would be 0, the second one would be 1 etc, so I would make i=0 for the first link, i=1 for the second etc…

Not sure if that logic makes sense, maybe there is a better way to pass the reference to the marker…

Can anyone help me out with this? Maybe a simply function where I can pass the marker’s value into my existing code? Or whatever you think would be the best way…

Thanks gurus!

  • 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-09T15:13:00+00:00Added an answer on June 9, 2026 at 3:13 pm

    Did you try defining an own function for handling the clicks?

    function myclick(i) {
        google.maps.event.trigger(markers[i],"click");
      }
    

    and

     function setHTML() {
        var html = "";
        for (var i=0; i<markers.length; i++) {
            html += '<a href="javascript:myclick(' + i + ')">' + marker[i].id + '<\/a>';
        }
        document.getElementById("table").innerHTML = html;
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been reading so many topics here about this, but I could not
I have been reading through this similar question and find myself less than satisfied
I have been reading this article: Many ways to communicate with your database using
I have been reading many topics on this subject, a drop down menu which
I have been reading many of the topics from this search so I really
I have been reading many posts that describe my problem but I cannot find
I have been reading the many posts on this topic and have been trying
I have been reading a lot about QR codes and how the code itself
I was reading Code Complete 2 and it mentions this: Many version-control tools wil
i have been reading a little about REST services and i would love 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.