05-03-2011 04:00 PM
I am displaying a few location on map using RichMapField, MapLocation, and MapDataModel (BlackBerry JDE 6.0.0).
How I can capture click or touch on location pin/marker to go to the detail screen?
How can I display user's current location using different pin (to distinguish from other markers)?
Is that possible, or should I use different approach?
Thanks,
Boogy
05-03-2011 04:12 PM
05-03-2011 04:21 PM
I did try searching, but no luck.
If anybody knows where is the good answer, please post a link!
Thanks,
Boogy
05-03-2011 11:43 PM
05-04-2011 08:25 AM
There is API´s to have different marker.. But you can try extending the RichMapField and add your own marker.. But I think it might be complex if you have many pointers (when you want to show each with different representation)
To capture the touch on location , may be you can try to make use of the API
convertWorldToField() , which converts the coordinates to Pixels to place it on the screen...
(Note : I have not tried it.. Just this will be the first one I will experiment with when hearing your requirements..)
05-04-2011 09:46 AM
Thanks sheeluwiki,
I believe your answer leading in good direction, but a few more questions:
what RichMapField's property to use to set icon used for marker?
Should I overwrite touch event, do you have any sample code for that?
Thanks!
05-04-2011 11:12 AM
RichMapField extends MapField..
May be you can override the paint() method for the customerized marker purpose.. The below code snippet can be used for reference.. But I am not sure if this is the correct method to be overriden..
protected void paint(Graphics graphics) {
super.paint(graphics);
if(myLocation != null) {
Coordinates co = mapField.getCoordinates();
co.setLatitude(Double.parseDouble(myLocation.getLa t()));
co.setLongitude(Double.parseDouble(myLocation.getL ng()));
XYPoint point = new XYPoint();
mapField.convertWorldToField(co, point);
Bitmap bitmap = Bitmap.getBitmapResource(myLocation.getImageName() );
graphics.drawBitmap(point.x, point.y, bitmap.getWidth(), bitmap.getHeight(), bitmap, 0, 0);
}
}
Please also look into below URLs for API reference..
http://www.blackberry.com/developers/docs/6.0.0api
http://www.blackberry.com/developers/docs/6.0.0api
I think you have to override the touchevent() of the Mapfield to capture your touch events..
06-19-2011 09:14 AM
using RichMapField and MapLocation, on the map is showed automatically a baloon with the info of location added. I need to know when the user click on this ballon or touch. How can I catch this event ?
07-08-2011 08:30 AM
I am looking for a solution for same issue.
anyone to help?
07-13-2011 11:52 AM
why any senior developer do not help on this topic??? ![]()