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

10Pcs T-Flash Tf Card To Micro Sd V2 Molex Card Adapter Module For Raspberry P Y
$7.31
10Pcs T-Flash Tf Card To Micro Sd V2 Molex Card Adapter Module For Raspberry P Y picture1Pcs Pic16f88-I/P Pic16f88 Mcu 8Bit 7Kb Flash Dip-18 New Ic V
$2.59
1Pcs Pic16f88-I/P Pic16f88 Mcu 8Bit 7Kb Flash Dip-18 New Ic V picture2Pcs Atmega324pa Atmega324pa-Au Mcu 8Bit 32Kb Flash 44Tqfp New Ic G
$3.62
2Pcs Atmega324pa Atmega324pa-Au Mcu 8Bit 32Kb Flash 44Tqfp New Ic G pictureUsed Nortel Business Phone System MICS Flash Voicemail WITH 10 M7310 Phones
$1394.94
Used Nortel Business Phone System MICS Flash Voicemail WITH 10 M7310 Phones pictureUsed Norstar Office telePhone System MICS Flash Voicemail +10 M7310 Phones
$1395.55
Used Norstar Office telePhone System MICS Flash Voicemail +10 M7310 Phones picture






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