I am using mapField to create a custom map.I am using the code in this link.
How to show more than one location in Blackberry MapField?.
But the map position is fixed. i am not able to drag the map as we can do in google maps or when we invoke the maps like
public void execute(ReadOnlyCommandMetadata metadata, Object context)
{
Invoke.invokeApplication(Invoke.APP_TYPE_MAPS, new MapsArguments());
}
Here’s some code that should get you going on the correct path. I’ve taken it from a project of mine that had some special requirements, so there could be some remnants of that left in there inadvertently. There will be some undefined variables in there — they’re member variables that are declared in the class and should all start with an underscore. This is also part of a class that extends
MapField, so you would have to create a custom map class and then use that rather than the default.As said, this might need tweaking for your use, but in general should get you started. The
MathUtilities.pow()calls were my way of coming up with an appropriate amount of motion depending on the zoom level.Edit for Comments
Letting a Bitmap move with the map:
I didn’t test any of that code, so it might be buggy but should give you the general idea.