Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Ti.Map at random location when in scrollview

$
0
0

Hello, I'm experimenting with the Ti.Map module from Appcelerator, and there's one thing that really bothers me right now:

When I create a map with a camera and annotation like this;

var locationAnnotation = Map.createAnnotation({
        latitude : 52.66014,
        longitude : 4.629045,
        title : "Golf van Bergen",
        pincolor : Map.ANNOTATION_CYAN
});
 
var locationCamera = Map.createCamera({
        altitude : 200,
        eyeCoordinate : {
            latitude : locationAnnotation.latitude,
            longitude : locationAnnotation.longitude
        },
        centerCoordinate : {
            latitude : locationAnnotation.latitude,
            longitude : locationAnnotation.longitude
        }
});
 
var locationMap = Map.createView({
        mapType : Map.NORMAL_TYPE,
        userLocation : true,
        camera : locationCamera,
        annotations : [locationAnnotation],
        height : Ti.UI.FILL,
        width : Ti.UI.FILL,
        top : 0
});
And I just add it to a window, everything's okay, it centers at the point of the annotation. But when I add it to a scrollview (var scroll = Ti.UI.createScrollView();) it suddenly centers at the Northern Atlantic Ocean.

Does anyone know a solution to this? I use Titanium SDK v3.4.1.GA on iOS 8.1 Simulator (iPhone 5s).


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>