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

Native Development

Reply
Developer
grenadedylex
Posts: 73
Registered: ‎04-08-2014
My Device: Z10
Accepted Solution

Drop pin from mapView

[ Edited ]

i have this mapview

my function 

function businessdetail(response){
       
        console.log("Response: "+response)
        var json = JSON.parse(response)
       
        map.longitude = json.longitude
        map.latitude = json.latitude
       
        }

 and this is my mapview

MapView {
                            id: map
                            preferredWidth: Infinity
                            preferredHeight: 600
                            altitude: 1000
       
                        
                        }

 i just want to have a pin that exactly it dropped from my longtitude latitude

and if i click the mapview it will have a marker road that start from my location, like this

tolong.png

 

any easiest way to do this?

and please share some codes

thanks

Developer
SumiGhosh
Posts: 435
Registered: ‎09-20-2011
My Device: Z10 LE, Playbook, DevAlpha C, 9900, 9380

Re: Drop pin from mapView

Check out the sample Mapview and Web Mapview

from the below link
https://developer.blackberry.com/native/sampleapps/
Developer
grenadedylex
Posts: 73
Registered: ‎04-08-2014
My Device: Z10

Re: Drop pin from mapView

yup i already check

but mapview and webmapview sample, we need to click drop pin so the pin will drop

in my app i want to directly drop to my lon and lat in the center

what should i erase?

thanks

Developer
bmorr
Posts: 331
Registered: ‎04-13-2013
My Device: Z10

Re: Drop pin from mapView

I tried to do this a while back.  It was getting frustrating so I just decided to push it off into the future.  I'll take a look at this tonight and see.  I believe you'd have to change the C++ code if you're using the mapview sample.

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Drop pin from mapView

i just posted my code to drop a pin here:
http://supportforums.blackberry.com/t5/Native-Development/Add-pin-in-a-MapView/td-p/2832726
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
grenadedylex
Posts: 73
Registered: ‎04-08-2014
My Device: Z10

Re: Drop pin from mapView

thanks for reply

because "I JUST NEED A MARKER IN THE CENTER OF MY MAP"

i do this

 

Container{
      topPadding : 15
      layout: DockLayout {
                    }
           MapView {
                 id: map
                 preferredWidth: Infinity
                 preferredHeight: 600
                 altitude: 1500
                            
                 overlapTouchPolicy: OverlapTouchPolicy.Deny
                 touchPropagationMode: TouchPropagationMode.None
                            
                        
                }
                 ImageView {
                      imageSource: "asset:///images/mapicon.png"
                      verticalAlignment: VerticalAlignment.Center
                      horizontalAlignment: HorizontalAlignment.Center
                      preferredHeight: 100
                      preferredWidth: 100
                       onTouch:{
                            tabPane.direction = true
                            tabPane.button = true
                            }
                        }
}

 hehe..

peace :Punk: :Punk:

Developer
bmorr
Posts: 331
Registered: ‎04-13-2013
My Device: Z10

Re: Drop pin from mapView

This is exactly what I ended up doing in my app because I couldn't figure it out. Although, depending on screen size and resolution make sure it's in the right place in alll of them.
Developer
grenadedylex
Posts: 73
Registered: ‎04-08-2014
My Device: Z10

Re: Drop pin from mapView

i already demo-ing in Z10 and its perfectly good

i dont know on the other device..

hope that the pin is in the right place for all bb10 devices :Cowboy:

Developer
bmorr
Posts: 331
Registered: ‎04-13-2013
My Device: Z10

Re: Drop pin from mapView

awesome!