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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:57:18+00:00 2026-06-03T19:57:18+00:00

Can you somehow reference other markers inside a marker? Link markers together, even though

  • 0

Can you somehow reference other markers inside a marker? Link markers together, even though they have different locations on a map.

Let’s say I have two types of markers for each person:
1st marker is the location of where the person lives, 2nd marker is the location of where the person works.

Say there are many of these markers on my map. You hover over one. The one you’ve hovered over and the second marker that is linked to that marker(associated with the same person) is highlighted.

How would you do that, theoretically?

  • 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-03T19:57:21+00:00Added an answer on June 3, 2026 at 7:57 pm

    I have an example, the idea is to keep an object (hash) or array of the various people, and when creating markers, assign who it belongs to (marker.owner). Later when it is selected, retrieve whose marker it is, and change the others from this information. The code below can be shortened, but the way it is left spread open you can see step-by-step what’s going on.

    http://jsfiddle.net/afTLh/

    <!DOCTYPE html>
    <html>
      <head>
        <style type="text/css">
          html, body, #map_canvas { margin: 0; padding: 0; height: 100% }
        </style>
        <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
        <script type="text/javascript">
          var map;
          var mapOptions = { center: new google.maps.LatLng(40.0, -90.0), zoom: 5,
            mapTypeId: google.maps.MapTypeId.ROADMAP };
    
          var people = {};
    
          function initialize() {
            map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
            addPerson("Joe",40,-88,41,-86);
            addPerson("Tina",42,-92,43,-93);
            addPerson("Ken",39,-94,39.5,-96);
          }
    
          function addPerson(name, homelat, homelng, worklat, worklng) {
            people[name] = {};
    
            homemarker = new google.maps.Marker({
              map: map,
              position: new google.maps.LatLng(homelat, homelng),
              icon: 'http://labs.google.com/ridefinder/images/mm_20_green.png'
            });
    
            workmarker = new google.maps.Marker({
              map: map,
              position: new google.maps.LatLng(worklat, worklng),
              icon: 'http://labs.google.com/ridefinder/images/mm_20_blue.png'
            });
    
            homemarker.owner = name;
            workmarker.owner = name;
    
            google.maps.event.addListener(homemarker, 'mouseover', function() {
              var name = this.owner;
              this.setIcon("http://labs.google.com/ridefinder/images/mm_20_red.png");
              people[name].work.setIcon("http://labs.google.com/ridefinder/images/mm_20_red.png");
            });
    
            google.maps.event.addListener(homemarker, 'mouseout', function() {
              var name = this.owner;
              this.setIcon("http://labs.google.com/ridefinder/images/mm_20_green.png");
              people[name].work.setIcon("http://labs.google.com/ridefinder/images/mm_20_blue.png");
            });
    
    
            google.maps.event.addListener(workmarker, 'mouseover', function() {
              var name = this.owner;
              this.setIcon("http://labs.google.com/ridefinder/images/mm_20_red.png");
              people[name].home.setIcon("http://labs.google.com/ridefinder/images/mm_20_red.png");
            });
    
            google.maps.event.addListener(workmarker, 'mouseout', function() {
              var name = this.owner;
              this.setIcon("http://labs.google.com/ridefinder/images/mm_20_blue.png");
              people[name].home.setIcon("http://labs.google.com/ridefinder/images/mm_20_green.png");
            });
    
            people[name].home = homemarker;
            people[name].work = workmarker;
          }
          google.maps.event.addDomListener(window, 'load', initialize);
        </script>
      </head>
      <body>
        <div id="map_canvas"></div>
      </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can I get somehow(from a database or other source) a percentage of the phones
Say I somehow got an object reference from an other class: Object myObj =
I have an Excel 2003 Spreadsheet which reference other add-ins. The add-ins are installed
Can I somehow disable ListView items navigation through keyboard (arrow keys), and leave navigation
Can you somehow lock an iPad to Safari and only one webpage? I've found
Can I somehow automatically add a node to a specific nodequeue when it is
I've been working all day and I somehow can't get this probably easy task
looper = (0..3).cycle 20.times { puts looper.next } can I somehow find the next
I would like to avoid the if statement below. Can I somehow copy the
This is something I know can be done somehow , because I've done it

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.