BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 12-10-2009, 02:31 AM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Mar 2007
Location: India
Model: 8100
Carrier: Airtel
Posts: 64
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question Capture click event of mapField

Please Login to Remove!

Hello All,

MapField map = new MapField(.....) //mymapfield object

I am using MapField in my application which has many points located.
For each point I have drawn an image say pinImage.
I am able to move it by capturing it's gasture event.
Now I want to capture its click event. When I click the map control goes to Click event.
But there how can I came to know which pinImage or which point is clicked.
I tried in following way but no use

XYRect rect = new XYRect();
map.getFocusRect(rect);

rect laways return x =0 and y =0. even though i click at any other point...
Can anybody please tell me how to get the clicked point data?


Thanks
__________________
Crazy for BlackBerry
Offline  
Old 12-15-2009, 03:27 AM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Mar 2007
Location: India
Model: 8100
Carrier: Airtel
Posts: 64
Post Thanks: 0
Thanked 0 Times in 0 Posts
Post Capture click event of mapField

Hi All,

I got the way. I done it in following way and working fine..

int x = message.getX(1);
int y = message.getY(1);
x = x - 20;
y = y - 50;
XYRect rect = new XYRect(x, y, 30, 30);

i have taken all the coordinates from the map..
conerted them one by one to XYPOint and the i checked whether the x,y points are in the rect above....

We can change the x and y in the XYRect as per our reuirements. I changed it bcoz i have drawn the image at such points..

Thanks
__________________
Crazy for BlackBerry
Offline  




Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.