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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:59:04+00:00 2026-06-04T15:59:04+00:00

I have created a google map located at: http://calwestcultural.com/sgs/example_map.html I am trying to link

  • 0

I have created a google map located at: http://calwestcultural.com/sgs/example_map.html

I am trying to link some text in my spry menu to the left with my google map markers/infowindow.

My javascript is limited as I tried to create ID’s for each marker and link to that id but it did not work. I am stumped at this point.

I also would like my markers to display the name when you hover your mouse over it. I achieved this using a different style map but had problems creating markers so the current one I am using above will be my final, I just have to get the links to reference correctly.

PLEASE ANY HELP WITH THIS WOULD GET RID OF MY JS HEADACHE RIGHT NOW!!!!!!!!!

  • 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-04T15:59:05+00:00Added an answer on June 4, 2026 at 3:59 pm

    This page shows one way of connecting a sidebar link to your markers

    http://www.wolfpil.de/v3/toggle-cats.html

    Copying this page’s patterns to your case, you need a gmarkers global variable

    //<![CDATA[
    var map = null;
    var gmarkers = [];
    function initialize() {
    

    The order in which markers are added matters, they should match the order of the businesses in the sidebar. gmarkers will be updated in createMarker.

    var point = new google.maps.LatLng(37.984798,-121.312094); 
    var marker = createMarker(point,'<div style="width:205px"><center><img src="images/sampleuopsign.jpg" /></center><h2>University of the Pacific</h2>3601 Pacific Avenue<br>Stockton, California 95211<br>209.946.2011<br><small>On the web visit: <a href="http://www.pacific.edu">www.Pacific.edu<\/a></small><\/div>')
    
    ...
    
    function createMarker(latlng, html) {
        var contentString = html;
        var marker = new google.maps.Marker({
            position: latlng,
            map: map,
            zIndex: Math.round(latlng.lat()*-100000)<<5
            });
    
        google.maps.event.addListener(marker, 'click', function() {
            infowindow.setContent(contentString); 
            infowindow.open(map,marker);
        });
        gmarkers.push(marker);
    }
    

    With the array in place, we can address them by index. Wolfpil simply triggers a click event when a sidebar entry (link) is clicked:

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

    And each link can be written like this, replacing 0 and 1 with the order each marker was added:

    <a href="javascript:triggerClick(0)">Bank of America</a>
    <a href="javascript:triggerClick(1)">Bank of Stockton</a>
    

    About the marker hover showing a title, the easiest way is adding a title option when creating your markers, but it would mean adding a new parameter to your createMarkers function:

     function createMarker(latlng, storeName, html) {
      var contentString = html;
    
      var marker = new google.maps.Marker({
        position: latlng,
        map: map,
        title: storeName,
        zIndex: Math.round(latlng.lat()*-100000)<<5
      });
    

    A better alternative in the long run is to use an object for gmarkers instead of the array, because adding an item in the middle of the list will disorganize the existing items in the HTML.

    Then, places can be called by a string ID, such as gmarkers['safeway']. Instead of pushing a marker to the array in createMarker, we assign the id to the marker:

    gmarkers[id] = marker;
    

    If you run into trouble write comments below please! I didn’t test the code above.

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

Sidebar

Related Questions

I have a number of public custom Google Maps created via http://maps.google.com/ - obviously
I have generated a Google map key by login as a user1@gmail.com . Is
I have a Google map I have created to highlight the location of several
I am trying to add markers to a google map created after an ajax
I have a Google Map created with V3 API, and I wish to apply
I have a module I created for Google Maps v3 that I'm trying to
I have a Google map I created in Javascript using the v3.8 api: var
I have created a simple app which shows a Google Map. I am testing
I have some google map markers that sit on a map. They are controlled
I have a Map object created through the google maps api and I want

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.