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

  • Home
  • SEARCH
  • 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 7821391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:38:09+00:00 2026-06-02T07:38:09+00:00

i am using google map api to show addresses on map with markers, the

  • 0

i am using google map api to show addresses on map with markers, the problem i am having is, In the marker, i am showing a link to go to the profile page of person which is there in the map, but if there are more than 1 person exists on same address then google group those addresses and doesn’t show the link, is there any way we can stop grouping of addresses?
Any help would be appreciated.Thanks

<pre>
<script type="text/javascript">
var global =0;
//<![CDATA[
if (GBrowserIsCompatible()) {
  var side_bar_html = "";
  var gmarkers = [];
  var htmls = [];
  var i = 0;

  var allIcon = new GIcon();
  allIcon.image = "images/icons/<?php echo $map_category; ?>-all.png";
  allIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
  allIcon.iconSize = new GSize(35, 29);
  allIcon.shadowSize = new GSize(37, 34);
  allIcon.iconAnchor = new GPoint(9, 34);
  allIcon.infoWindowAnchor = new GPoint(9, 2);
  allIcon.infoShadowAnchor = new GPoint(18, 25);
  allIcon.transparent = "http://www.google.com/intl/en_ALL/mapfiles/markerTransparent.png";
  allIcon.printImage = "coldmarkerie.gif";
  allIcon.mozPrintImage = "coldmarkerff.gif";

  // An array of GIcons, to make the selection easier
  var icons = [];
  icons[0] = allIcon;
  icons[1] = planIcon;
  icons[2] = specialIcon;

  var clusterIcon = new GIcon();
  clusterIcon.image = 'images/icons/<?php echo $map_category; ?>-all.png';
  clusterIcon.iconSize = new GSize( 30, 51 );
  clusterIcon.shadowSize = new GSize( 56, 51 );
  clusterIcon.iconAnchor = new GPoint( 13, 34 );
  clusterIcon.infoWindowAnchor = new GPoint( 13, 3 );
  clusterIcon.infoShadowAnchor = new GPoint( 27, 37 );


  // A function to create the marker and set up the event window
  function createMarker(point,name,html,cat,id) {
    var marker = new GMarker(point,icons[cat]);
    GEvent.addListener(marker, "click", function() {
    rating_html = CallRating(<?php echo $page_id; ?>,id);
    rating_html = decodeURI(rating_html);
    marker.openInfoWindowHtml(html);        
    document.getElementById("rating_html_"+id+"").innerHTML=rating_html;
    });
    GEvent.addListener(marker, "dragstart", function() {
      map.closeInfoWindow();
    });
    // save the info we need to use later for the side_bar
    gmarkers[i] = marker;
    htmls[i] = html;
    // add a line to the side_bar html
    if(i%2==0)
    {
        var sclass="even";
    }
    else
    {
        var sclass="odd";
    }
    side_bar_html += '<li class="'+sclass+'"><a href="javascript:myclick(' + i + ',' + id + ')" class="map_data mapdata-list">' + name + '<\/a></li>';
    global=i;
    i++;
    return marker;
  }

  // This function picks up the click and opens the corresponding info window
  function myclick(i,id) {
    rating_html = CallRating(<?php echo $page_id; ?>,id);
    rating_html = decodeURI(rating_html);
    gmarkers[i].openInfoWindowHtml(htmls[i]);           
    document.getElementById("rating_html_"+id+"").innerHTML=rating_html;
  }


  // create the map
  var map = new GMap(document.getElementById("map"));
  map.addControl(new GLargeMapControl());
  map.addControl(new GMapTypeControl());
  //map.setMapType(G_SATELLITE_MAP);
  map.setCenter(new GLatLng(<?php echo $emp_info['emp_latitude']; ?>, <?php echo $emp_info['emp_longitude']; ?>), 8);
  // create the clusterer
  var clusterer = new Clusterer(map);

  // set the clusterer parameters if you dont like the defaults
  clusterer.icon = clusterIcon;      
  clusterer.maxVisibleMarkers = 100;
  clusterer.gridSize = 5;
  clusterer.minMarkersPerClusterer = 5;
  clusterer.maxLinesPerInfoBox = 6;

  var rating_html="";   
  // Read the data 
  var request = GXmlHttp.create();
  request.open("GET", "xml/<?php echo $org_id.'/emp/'.$emp_id.'/'.$map_category; ?>.xml", true);
  request.onreadystatechange = function() {
    if (request.readyState == 4) {
      var xmlDoc = GXml.parse(request.responseText);
      // obtain the array of markers and loop through it
      var markers = xmlDoc.documentElement.getElementsByTagName("marker");
      var i = 0;
      for (i = 0; i < markers.length; i++) {
        // obtain the attribues of each marker
        var lat = parseFloat(markers[i].getAttribute("lat"));
        var lng = parseFloat(markers[i].getAttribute("lng"));
        var point = new GPoint(lng,lat);
        var town = markers[i].getAttribute("town");
        var name = markers[i].getAttribute("name");
        var id = markers[i].getAttribute("id");
        var cat = markers[i].getAttribute("cat");
        var marker = createMarker(point,name,"<a href='<?php echo $url;?>="+id+"' target='_blank' class='map_data'>"+name+"</a><br>"+town+"<div id='rating_html_"+id+"'></div>",cat,id);
        // create clusterer object
        clusterer.AddMarker(marker,town);
      }
      // put the assembled side_bar_html contents into the side_bar div
      if(side_bar_html=="")
      {
        document.getElementById("list_html").innerHTML = "<li>No data found! Please try again.</li>";
      } 
      else
      {
          document.getElementById("list_html").innerHTML = side_bar_html; 
          gmarkers[global].openInfoWindowHtml(htmls[global]);
          map.closeInfoWindow();
      }   
      // Clear the "please wait" message
    }
  }
  request.send(null);
}

else {
  alert("Sorry, the Google Maps API is not compatible with this browser");
}

//]]>
</script>
</pre>
  • 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-02T07:38:11+00:00Added an answer on June 2, 2026 at 7:38 am

    It is a good thing that google is showing all the relative address together otherwise if it wont, markers will be hidden by each other and you wont be able to see even how many markers are there on one place.

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

Sidebar

Related Questions

I'm having trouble getting my markers to show up using Google Maps API V3.
I'm using the Google Maps API to build a map full of markers, but
I'm using the Google Maps API v2. I add markers to the map and
I'm developing a map application in Android. I'm using Google maps API to show
I'm trying to get multiple markers on a Google map using API V3. The
I'm using google maps api to have a map show up on my website
I'm using Google Maps Javascript API for showing a map in my site with
I'm using the Google Maps API (v3) on my website to show a map
I am using google map api version 3 . Now i want to link
i am using google map v3 api i would like to show information bubble.

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.