I have two pairs of lat long values
currLat = 19.12696395;
currLong = 72.87338733;
collCurrLat = 19.12238216;
collCurrLong = 72.875275605;
I want to plot currLat and currLong at the center of the screen and collCurrLat and collCurrLong at location relative to it on the screen by depicting collCurrLat and collCurrLong as a small circle.
int x = ((MapView)mParent).getWidth()/2;
int y = ((MapView)mParent).getHeight()/2;
//LatLonToPixel takes lat , long and zoom level as parameters.
cPoint cpt = GlobalMercator.LatLonToPixel(currLat, currLong, 16);
cPoint cptColl = GlobalMercator.LatLonToPixel(collCurrLat, collCurrLong, 16);
int testx = cptColl.cx-cpt.cx + x;
int testy = cptColl.cy-cpt.cy + y;
canvas.drawCircle(testx,testy,smallradius, mSelectionBrush);
I tried the above code. But gives me random positions. Is this approach correct?