how can I display an image in th exact center of a map view?

You must Login before you can answer or comment on any questions.

I want to create something like "choose your location" when there is a pin image in the center of a map which is static and you can move the map. when the button select is clicked i just take the lat/lng of the map and i know that was the selected location.

But I don't know the map's height as it can be changed by user. How would you place the image in the exact center? the image is a X sign

— asked 9 months ago by Ryan popa
0 Comments

2 Answers

What I did was to create a view and set the image as background image. Then I add the view to the center of the view(that holds the map). This is the sample of my code:

var pin = Ti.UI.createView{(
    backgroundImage: 'pin.png',
    center: {x:0, y:0}
});
view.add(pin);

Your Answer

Think you can help? Login to answer this question!