I want to display a point with a latitude and a longitude value in an isometric world map using JavaScript and jQuery.
For a rectangular map, I use the following code to calculate the x and y position of the marker:
marker.y = map_range(position.lat, 90, -90, 0, $('#map').height()); marker.x = map_range(position.lng, -180, 180, 0, $('#map').width()); function map_range(value, low1, high1, low2, high2) { return low2 + (high2 - low2) * (value - low1) / (high1 - low1); }
How do I transfer this formula to a pseudo-isometric map? (skewed 45 degrees, height = .5 * width)?
P.S. I first posted this question on StackOverflow, and people directed me here to ask for an answer. For those not familiar with JavaScript or jQuery: $('#map').height()
represents the height of the map, the same goes for the width. If you have any other questions about the code, please ask.