Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 72358

How to convert x,y coordinates to work with absolute display?

$
0
0

I receive X,Y coordinates from an API call. They look like this:

x: "-0.0120956897735595703"
y: "0.147876381874084473"

I've set the display on each of these minimap images to be absolute. I'm setting the "left" and "top" properties to be the X and Y coordinates like so: style={{left: player.x, top: player.y}} but it seems like the numbers are too small to do anything. Right now all the images are displayed in the top left corner because the x and y coordinates are too small.

How can I convert the X and Y coordinates so that the minimap images will be accurately displayed on the map? And which unit will i need to use?

Div with a background of the minimap, and multiple minimap icons that are stuck in one place


Viewing all articles
Browse latest Browse all 72358

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>