# Need some help with a scale map of the solar system

**URL:** https://forum.kirupa.com/t/need-some-help-with-a-scale-map-of-the-solar-system/332090
**Category:** web dev
**Created:** [January 24, 2014, 11:08pm UTC](https://forum.kirupa.com/t/need-some-help-with-a-scale-map-of-the-solar-system/332090 "2014-01-24T23:08:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![misterjworth](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@misterjworth](https://forum.kirupa.com/u/misterjworth)
#### Post date: [January 24, 2014, 11:08pm UTC](https://forum.kirupa.com/t/need-some-help-with-a-scale-map-of-the-solar-system/332090/1 "2014-01-24T23:08:36Z")

</div>

[COLOR=#000000][FONT=Arial]I’m working on a scale map of the solar system (just for fun) and I’m pretty far along, but I’m trying to implement a feature that’s a little over my head. I was hoping someone smarter might have some insight.[/FONT][/COLOR][COLOR=#000000][FONT=Arial]  
[/FONT][/COLOR]  
[COLOR=#000000][FONT=Arial]You can see the site here: [/FONT][/COLOR]

[COLOR=#000000][FONT=Arial][http://joshworth.com/dev/pixelspace/pixelspace\_solarsystem.html[/FONT][/COLOR][COLOR=#000000][FONT=Arial]](http://joshworth.com/dev/pixelspace/pixelspace_solarsystem.html%5B/FONT%5D%5B/COLOR%5D%5BCOLOR=#000000%5D%5BFONT=Arial%5D)  
[/FONT][/COLOR]  
[COLOR=#000000][FONT=Arial](I haven’t looked at it on a PC, so there might be some other problems.)[/FONT][/COLOR]

[COLOR=#000000][FONT=Arial]In the area that currently shows 0000kM (near the bottom) I’d like to display a continuously updated number that indicates the current distance from the sun.[/FONT][/COLOR]

[COLOR=#000000][FONT=Arial]It seems like if I can get the x coordinates of an element within the div that contains the map, then I could multiply that by the map scale (1px = 3474.8 kM) in order to get the measurement.[/FONT][/COLOR][COLOR=#000000][FONT=Arial]  
[/FONT][/COLOR]  
[COLOR=#000000][FONT=Arial]I was looking at this article[/FONT][/COLOR]  
[COLOR=#000000][FONT=Arial][http://www.kirupa.com/html5/get\_element\_position\_using\_javascript.htm](http://www.kirupa.com/html5/get_element_position_using_javascript.htm) which seems like it would be helpful, but I’m not familiar enough with javascript to create a listener that updates and displays the measurement in real-time.[/FONT][/COLOR]

[COLOR=#000000][FONT=Arial]Anybody have any thoughts? [/FONT][/COLOR]
