There does not seem to be a lot of information on the “Custom Map Field” features. I am adding Images to my custom MapField and would like to make those images clickable. If anyone is familiar with this please let me know and ill post my Code snippet , etc.
Thank you
There are two MapField classes in the API: the old
net.rim.device.api.lbs.MapField, available since OS 4.5, and the newernet.rim.device.api.lbs.maps.ui.MapField, available from OS 6.0 onwards. For the newest one, the default action when an item is clicked is to show a dialog with info, but I think you could listen for clicks by setting a customMapActioninstance in the MapField. If not possible, then for both old and new mapfields you can overridenavigationClickand look for the nearest clickable item to the map center. This nearest neighbour lookup should be optimized in case you have a large number of clickable items (for instance, skipping all non visible elements). For touchscreen enabled devices, you can overridetouchEvent, retrieve the clicked position and do the same.Actually both approaches are compatible.