H I have written a code to draw two custom location markers on the MapField. But when i zoom in and zoom out, the location marker is of the same size, I want the location marker to adjust according the zoom level. Could someone please help me put on this??
BR, Suppi
edit:
So far am able to do this,
mPointDest = new XYRect[mPoints.length];
for (int i = 0; i < mPoints.length; i++) {
XYPoint fieldOut = new XYPoint();
convertWorldToField(mPoints[i], fieldOut);
mIcon = Bitmap.getBitmapResource("location.png");
int imgW = mIcon.getWidth();
int imgH = mIcon.getHeight();
mPointDest[i] = new XYRect(fieldOut.x - imgW / 2,
fieldOut.y - imgH, imgW, imgH);
graphics.drawBitmap(mPointDest[i], mIcon, 0, 0);
and for zoom :
protected boolean keyChar(char character, int status, int time)
{
// 'i' will zoom in.
if (character == 'i')
{
mMapField.setZoom(Math.max(mMapField.getZoom() - 1, mMapField.getMinZoom()));
return true;
}
// 'o' will zoom out
if (character == 'o')
{
mMapField.setZoom(Math.min(mMapField.getZoom() + 1, mMapField.getMaxZoom()));
return true;
}
return super.keyChar(character, status, time);
}
After this am wondering how to go about adjusting the bitmap based on the zoom level. Can someone please give me some idea??