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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:23:56+00:00 2026-05-25T12:23:56+00:00

I am working to create a map to show based upon IP’s of the

  • 0

I am working to create a map to show based upon IP’s of the people on my site. I was thinking a cool map showing all the places around the globe that were hitting the map. But I have come into a little issue. I have the ip’s being tracked, and then from their they are processed in a Geo query, and finally I’m using pusherapp to post the data to the map. However, now I can make a unordered list, by appending the datato my site, but I can’t figure out how to add it to my google map, nor have that map redraw with the data. Can someone help me here?
So basically on the server side:

var bounds = new google.maps.LatLngBounds();
var latlng = new google.maps.LatLng( #{@a.lat}, #{@a.lng});

    var marker = new google.maps.Marker({
      animation: google.maps.Animation.DROP,
      icon: 'images/marker.png',
      map: map,
      position: latlng,
      title: 'Here'
    });

    bounds.extend(latlng);
    map.fitBounds(bounds);

followed by on the client side:

channel.bind('latitude', function(data){
 $('#list').append(data);
});  

But even if I do get it to plop into the script section is that google map going to know how to update?
I would really like to keep this all in Rails, and for the service I’m right now using pusher
Thanks!

  • 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-25T12:23:57+00:00Added an answer on May 25, 2026 at 12:23 pm

    thanks for using our service.

    By the sounds of it you should be using our presence functionality so that you can keep track of users leaving and joining your site.

    Part of the presence functionality is that when a user subscribes to a channel an AJAX call is made to your server. Within that call you can do your IP lookup and then return the details (I would suggest just the lat and long values) of that lookup as the user_info to the presence request. See Authenticating Users for more information on this. These docs also provide a Rails example of authenticating a user and providing user_info for that user.

    When any user subscribes the the presence channel in the client they will get an initial list of connected users. You can loop through that user list and get the info for each user and add a marker to the Google map. When new users join you will get member_added events on the channel and you can add a new marker. When users leave you will get a member_removed event and you can remove a marker.

    An example of the client code might be:

    var channel = pusher.subscribe('presence-site-map-channel');
    
    // Initial list of users on the site
    channel.bind('pusher:subscription_succeeded', function(members) {
      members.each(function(member) {
        addMember(member);
      });
    });
    channel.bind('pusher:member_added, addMember);
    channel.bind('pusher:member_removed, function() { /* TODO: implement */});
    
    function addMember(member) {
      var bounds = new google.maps.LatLngBounds();
      var latlng = new google.maps.LatLng( member.info.lat, member.info.long);
    
      var marker = new google.maps.Marker({
        animation: google.maps.Animation.DROP,
        icon: 'images/marker.png',
        map: map,
        position: latlng,
        title: member.info.id // each user must have a unique ID and you could use it here
      });
    
      bounds.extend(latlng);
      map.fitBounds(bounds);
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a game where I create a random map of provinces (a
I am working in android. I want to show simple google map in my
I am working on a project where I am going to create a map
I have one application for showing the map but it is not working does
I create a working repository in HG. And I have modified some files. How
In working with Linq to Sql I create a seperate class to ferry data
I am working on a website where Users create their accounts. I need to
I am working on a program that needs to create a multiple temporary folders
I'm working with my ASP.NET development team to try and create better (i.e. cleaner)
I'm working on an application that is supposed to create products (like shipping insurance

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.