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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:26:47+00:00 2026-06-07T09:26:47+00:00

I have a nodejs app which takes the user’s ip address and trasposes it

  • 0

I have a nodejs app which takes the user’s ip address and trasposes it onto a raphael map based on the user’s lat/lon position.

you can see it here http://zmgc.net/;maps if you open a new tab and access the http://zmgc.net home page in the ;maps page you should get a red person svg which is centered.

the weird thing is that the City and ‘Users title’ are correctly displayed, but the person renders in the middle of the map!

here is the code that draws the person marker:

  this.drawMarker = function (message) {
    var latitude = message.latitude,
        longitude = message.longitude,
        text = message.title, //Fixme, this is the user's name
        city = message.city,
        x, y;

    var mapCoords = this.geoCoordsToMapCoords(latitude, longitude);
    x = mapCoords.x;
    y = mapCoords.y;

    var person = self.map.path(personPath);
    person.scale(0.06, 0.06);
    person.translate(-255, -255); // Reset location to 0,0
    person.translate(x, y);
    console.log(x, y);
    person.attr({
      fill: 'red',
      stroke: 'transparent'
    });

    var title = self.map.text(x, y + 11, text);
    title.attr({
      fill: 'red',
      "font-size": 12,
      "font-family": "'Helvetica Neue', 'Helvetica', sans-serif",
      'font-weight': 'bold'
    });
    var subtitle = self.map.text(x, y + 21, city);
    subtitle.attr({
      fill: '#999',
      "font-size": 7,
      "font-family": "'Helvetica Neue', 'Helvetica', sans-serif"
    });

the full code is https://github.com/nkhine/phoenix/blob/master/ui/core/js/node/public/client.js

any advice much appreciated.

  • 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-07T09:26:48+00:00Added an answer on June 7, 2026 at 9:26 am

    first translate that then scale, because scale() will affect following translates()

    so in the code would be:

    var person = self.map.path(personPath);
    person.translate(-255, -255); // Reset location to 0,0
    person.translate(x, y);
    console.log(x, y);
    person.scale(0.06, 0.06);
    person.attr({
      fill: 'red',
      stroke: 'transparent'
    });
    

    but the correct correct sollution should be moving the path itself, not transforming its coordinate system. This is explained with an example here:
    http://cancerbero.vacau.com/raphaeltut/#sec-types-path-moving

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

Sidebar

Related Questions

I have this NodeJS app which fetches JSON-type response from a web application and
I have recently been working on a nodejs app which uses open socket connections
I have a NodeJS app which sends HTTP get requests from various places in
I have a node.js app which routes events to a web page's shotbox which
i am new to heroku and node.js. i have a small node.js app which
I have a WPF App which is grinding to a halt after running out
I have an application (cad like editor) in which the user may place a
I'm building my node.js app which has the following structure: server.js controllers/user.js server.js require
I have a Node.js app which I'm attempting to deploy to Heroku. However, Heroku
I have a very simple node.js app built on express which has been handling

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.