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  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Genuine OEM Dell RF223 High Yield Toner Cartridge CN-0RF223 5,000 For 1815dn
$25.0
Genuine OEM Dell RF223 High Yield Toner Cartridge CN-0RF223 5,000 For 1815dn  pictureGenuine OEM Dell 3200MP Osram Replacement Lamp & Housing 310-2328
$79.99
Genuine OEM Dell 3200MP Osram Replacement Lamp & Housing  310-2328 pictureOEM Dell Alienware M17X R2 Video Graphics Card GPU RV546 ATI 5870m 1GB 731MJ
$89.99
OEM Dell Alienware M17X R2 Video Graphics Card GPU RV546 ATI 5870m 1GB 731MJ  pictureGenuine, NEW Dell 3110cn, 3115cn Transfer Belt unit in Box Neo OEM
$199.95
Genuine, NEW Dell 3110cn, 3115cn Transfer Belt unit in Box Neo OEM pictureDell Inspiron N5040 OEM LCD Front Cover Bezel 0mr95c
$17.0
Dell Inspiron N5040 OEM LCD Front Cover Bezel 0mr95c picture






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