Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Posts: 21
Registered: ‎06-01-2011
My Device: Curve
My Carrier: Verizon

Redraw map marker on map pan

I have to support some mapping fuctionality for version 5 OS (and am using the 9530 simulator to test it). I am able to display a map and put a map marker on a location, but I can't get the map marker to shift with the map when the map is panned. I have implemented panning using the keyboard as follows: xOffset = xOffset + XWEST; yOffset = yOffset + YNORTH; _mapField.move(XWEST, YNORTH); To draw the map marker, I override the paint method for my map field as follows: super.paint(graphics); GPSLoc tmpLoc = GPSLoc.getLocation(); Coordinates coords = new Coordinates(tmpLoc .getLatitude(), tmpLoc .getLongitude(), 0); XYPoint point = new XYPoint(); convertWorldToField(coords, point); Bitmap bitmap = Bitmap.getBitmapResource("Location_marker.png"); graphics.drawBitmap(point.x - (bitmap.getWidth()/2) + xOffset, point.y - bitmap.getHeight() + yOffset, bitmap.getWidth(), bitmap.getHeight(), bitmap, 0, 0); I thought setting the xOffset and yOffset would move my map marker to the proper position, but it appears that it isn't being redrawn, even though the code is called. Thanks in advance for any help.