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
2 Answers
view.center = { x: '50%', y: '50%' };
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!