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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:13:11+00:00 2026-05-23T15:13:11+00:00

I have a clickable marker that I want to attach either a ‘class’ or

  • 0

I have a clickable marker that I want to attach either a ‘class’ or an ‘id’ tag to,
much the same way you would in <a href='' id='???'>.

<div id="map" style="width: 500px; height: 400px;"></div>
<script type="text/javascript">
var map = new google.maps.Map(document.getElementById('map'), {
  zoom: 2,
  center: new google.maps.LatLng(35.55, -25.75),
  mapTypeId: google.maps.MapTypeId.ROADMAP
});

var marker = new google.maps.Marker({
  position: map.getCenter(),
  url: '#popup1',
  map: map
});

google.maps.event.addListener(marker, 'click', function() {
  window.location.hash = marker.url;
});


For those also wanting the answer: I found SimpleModal.

http://www.ericmmartin.com/projects/simplemodal/

I then used $(“#element-id”).modal(); on marker click event, which launches an external Jquery window.

Thanks for your time though, Loïc!

  • 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-23T15:13:11+00:00Added an answer on May 23, 2026 at 3:13 pm

    Perhaps you will be able to get the dom node following the suggestions made here:
    Get DOM Element of a marker in Google Maps API 3

    Still, accessing the dom node (in order to set the id and a css class) doesn’t seems to be the way the google map engineering team designed the marker. In fact, the marker is assigned an id by the google map api, i wouldn’t tamper with it as it may break functionality.

    If what you want is to alter the visuals of the marker, you can use Icons, instead of markers. Icons are markers with a custom image. You can get more info here:
    http://code.google.com/apis/maps/documentation/javascript/overlays.html#Icons

    And if you want to get a hold on the marker itself you can store it on an array and access it later on your code.

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

Sidebar

Related Questions

I am dynamically creating a table which I want to have clickable rows. When
I would like to have formatted, clickable text and images inside a selected UITableViewCell.
I have a dialog application in which I want to have clickable menu items
I have a WP7 app where I would like to have a clickable TextBlock
I want to be able to have some text clickable like in webpages in
I have clickable row, that will fire link onclick event, but trigger() cause a
I have a clickable FrameLayout and I want to display a few quick actions
I have a clickable div and within that div is link. When the link
I am trying to have a clickable div so that when its clicked it
Lately, I've been seeing a lot of sites that have clickable objects that don't

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.