Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 638
Registered: ‎07-02-2009
My Device: Not Specified

Clickable Pin Points on a map.

Hi all,

 

I have a requirement to pin the markers on a map at particular x,y which will come from the webservices.

 

1) the map image is from the webservices.

 

2) the x,y points where we need to show the markers are from teh webservices.

 

3) i added teh map to the screen as scrollbale image field. ( map image is a bitmap field).

 

4) to make the markers clickable i took bitmapfields. and overriddent the navigationclick.

 

finally, i got the map as required with the markers.. but when i clilck on the markers the screen is getting repainted and teh map is not getting invisible.

 

in short, i have a large bitmapfield over which am placing different bitmap fields. and causing problems when am trying to click the bitmpafileds (markers).

Thanks and Regards,
PraveenGoparaju.
Developer
Posts: 638
Registered: ‎07-02-2009
My Device: Not Specified

Re: Clickable Pin Points on a map.

anyhelp

Thanks and Regards,
PraveenGoparaju.
New Developer
Posts: 2
Registered: ‎11-14-2008
My Device: Not Specified

Re: Clickable Pin Points on a map.

Hi Blanc,

 

my suggestion - have one customized image field, that will manage focus moving (move highlighting mark between marks), trackball clicking (invoke action with currently highlighted mark), painting (paint map and mark images in a proper place).

 

Thanks,

Eugen

Developer
Posts: 467
Registered: ‎07-16-2009
My Device: Z10 LE
My Carrier: Vodafone NL

Re: Clickable Pin Points on a map.

Sorry, I've replied from my old account.

 

Eugen

Developer
Posts: 638
Registered: ‎07-02-2009
My Device: Not Specified

Re: Clickable Pin Points on a map.

can you be little bit clearer??

Thanks and Regards,
PraveenGoparaju.
Developer
Posts: 467
Registered: ‎07-16-2009
My Device: Z10 LE
My Carrier: Vodafone NL

Re: Clickable Pin Points on a map.

Hi Blanc,

 

in my implementation I will have one image field that also has array of pin points coordinates and item index that is selected. For example initial value of selected index will be 0 if I moved on the image field from top and array.size-1 if from the bottom.

 

After I will customize painting - add painting of pinpoints  in additional to map painting. Also will somehow highlight the selected item - draw border, background or choose other image.

 

And the last one I will override focus moving (navigation movement) in the field. Set next selected pin index in dependence on dx, dy of movement and call invalidate.

 

Thanks,

Eugen

New Developer
Posts: 7
Registered: ‎12-29-2009
My Device: Not Specified

Re: Clickable Pin Points on a map.

Hi Blanc

Here Are Your Points

 

1) the map image is from the webservices.

 

2) the x,y points where we need to show the markers are from teh webservices.

 

3) i added teh map to the screen as scrollbale image field. ( map image is a bitmap field).

 

4) to make the markers clickable i took bitmapfields. and overriddent the navigationclick.

 

(1) Means that most probably you are using Google's web service. Use Blackberry maps instead. Specially use it's Custom map field. By using this you can put the markers where you want.

 

Let's hope you get latitude and longitude where you are to put the markers. Just convert it to pixels and put the marker images there in custom map screen's paint method.

 

If you are using storm than get x,y on touch or click or just get the marker image in your center. Than get

the location of the click event and get Lat long based on it.(BB api has the method for converting lat lon from and to x,y of screen).

 

Determine if your click is on exact where you want and than put a popup or push a new screen or create your desired event.

 

In our application we use the same logic to generate click event on markers that are nothing more than a bitmap.

 

Let's hope that i'm clear to you..and you got all my points.

Developer
Posts: 638
Registered: ‎07-02-2009
My Device: Not Specified

Re: Clickable Pin Points on a map.

Hi prash,

 

thanks for your interest, basically the map is not any google map or blackberry map. its a custom bitmap image that represents a location. and the x, y points are directly the x, y positions but not  lat n long values.

 

 

Thanks and Regards,
PraveenGoparaju.
Highlighted
Contributor
Posts: 10
Registered: ‎11-11-2011
My Device: NA
My Carrier: NA

Re: Clickable Pin Points on a map.

hey prash_h_trvedi  can you help me with some code.. I'll be thankful to you..