Closed Caspain closed 7 years ago
i don't know of a way off hand - there's no "curve" built in - it just takes whatever you say your left and right edges are, and find the relative position for any number between them.
i'm sure someone has done it, and you could probably customize the positioning stuff without too much trouble (by computing yourself and not using relative bounds at all), but i don't know off hand of any resources - sorry.
I see, thank you . But for guidance, (by computing yourself and not using relative bounds at all), the map is a grid of pixels. By nature their relative. what exactly do you mean?
all TileView does is find a relative position between edges.
if you're left edge is say 50, and your right edge is 100, and someone passes in a coordinate of 60 it will be at a point 20% between left and right.
double distance = right - left;
float relative = (coordinate - left) / distance;
that would give you 0.2, which means 20% of the way across. you then apply that to pixels to get the actual coordinate on screen:
int pixel = width * relative;
As you can see, it's a very simple system. It does not take into account the curve of the earth. That said, you can supply whatever bounds you want - or none, and compute pure pixel positions yourself - however works best for you app.
Hey moagrius , I have previously mentioned this before, according to relative coordinates positioning. Your examples works perfectly , when i bound my map similarly it also works.
Though not exactly, let me expound, when i bound my coordinates south east and north west,it relatively maps the coordinates. However when i pulled live gps coordinated and then use add marker , it position is way off. eg. lat 18.02232 lon = -76.432221 , it appears the precision is up to the third digit at most.
So my question is, do you know any way mathematically or logically map the real coordinated in relation to the ones generated by the tileview(Coordinate Translator is pixel based).