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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T17:30:50+00:00 2026-06-03T17:30:50+00:00

[Refer to https://github.com/apneadiving/Google-Maps-for-Rails/wiki/Markers] I followed instructions for creating a GMap sidebar. This is not

  • 0

[Refer to https://github.com/apneadiving/Google-Maps-for-Rails/wiki/Markers%5D

I followed instructions for creating a GMap sidebar. This is not
quite what I want to achieve. Bear in mind that my GMap contains
heterogeneous markers, a subset of which I would like to highlight
in auxiliary HTML content near the GMap (Eg, in a table or whatever):

Question #1: where do you loop over all markers and select only those
for which you want auxiliary HTML content? (I know you have block-support
logic for supplementing the default JSON for each marker; I’m not sure that’s what I need.)

Question #2: Is there some callback in javascript that I can implement,
so that when a marker is rendered, I can check what kind of marker it is,
and then appropriately modify the DOM (ie, the auxiliary HTML content)?

My view is that the JSON for each marker should have a property that
can uniquely identify that marker. Maybe for now it is simply the “description”
attribute. Then provided we have some callback in javascript, we can deference
only those markers that belong to a certain “description” category — Eg, the
“red, white, and blue” markers. The callback in javascript can then manipulate
the relevant elements in the DOM, thus creating the auxiliary custom HTML content
alongside the GMap.

  • 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-03T17:30:51+00:00Added an answer on June 3, 2026 at 5:30 pm

    If you want to get unique identifier for each marker, you should use every object id:

    your_objects.to_gmaps4rails do |obj, marker|
      marker.json({id: obj.id})
    end
    

    Answer1:

    All markers are stored by default in Gmaps.map.markers. You could get the id of the first marker this way: Gmaps.map.markers[0].id

    So create your own function with your adequqte logic.

    Answer2:

    The callback to use is Gmaps.map.callback.

    Basically, do:

    <%= gmaps(your_options) %>
    
    <% content_for :scripts do %>
    <script type="text/javascript">
    Gmaps.map.callback = function() {
      //your code
    }
    </script>
    <% end %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to https://github.com/clojure/core.logic/wiki/Differences-from-The-Reasoned-Schemer core.logic supports listo. However, the following piece of code does not
I tried to run the https://github.com/flatiron/director#client-side example to get familiar with director.js. I am
The code related to this question is here: https://github.com/jchester/lua-polarssl/tree/master/src Currently I'm trying to wrap
Let's say I have a fixed sidebar that is XXpx tall (Refer to http://www.getskeleton.com/
I'm trying to replace fixture generation with factories using rails3-generators: https://github.com/indirect/rails3-generators#readme The gem is
I'm trying to use the Homebrew install script: /usr/bin/ruby -e $(curl -fsSL https://raw.github.com/gist/323731) It
I am working on Galaxy Nexus(Android 4.0.3). I refer this to link https://developer.android.com/training/camera/photobasics.html to
Various documentation such as http://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Git and http://help.github.com/ssh-key-passphrases/ Refer to restarting git bash. How do
Please refer to my page http://vault-x.com/v3/contact.html Contact me via email: hello[at]vault-x.com Follow Vault-X on
Please refer to the topic http://www.codeproject.com/KB/viewstate/SaveViewState.aspx . The topic demonstrates how you can save

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.