Quantcast
Viewing all articles
Browse latest Browse all 8068

Mapview doesn't center around region

This is my mapview declaration

<View id="map" ns="Ti.Map" onClick="mapClick" animate="true" regionFit="true" userLocation="true" mapType="Ti.Map.STANDARD_TYPE">
    <Annotation id="eventLocation" pincolor="Titanium.Map.ANNOTATION_RED">
</View>
In my controller i call the following code
$.eventLocation.latitude = event.location.latitude;
    $.eventLocation.longitude = event.location.longitude;
 
    $.map.region = {
        latitude: event.location.latitude,
        longitude: event.location.longitude,
        latitudeDelta: 0.01,
        longitudeDelta: 0.01
    };
The annotation is created in the right spot, but the map isn't centered on it. What am i doing wrong? SDK version is 3.1.1. Problem occurs on iPhone

Viewing all articles
Browse latest Browse all 8068

Trending Articles



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