I have a map object, which has a map with a annotation on it. So I have zoomed in a bit, and positioned the map, as I want to use that state as the default map when it loads.
So I am using 'regionChanged' to determine zoom, and location.
this.the_map = central.drawMap(this, 0.05, 0.05); Central.prototype.centreMap = function(parent_obj, location, zoom_lat, zoom_long) { parent_obj.setLocation({ longitude : location.lng, latitude : location.lat, animate : true, latitudeDelta : zoom_lat, longitudeDelta : zoom_long }); } Central.prototype.drawNationalPark = function(parent_obj, location, name) { parent_obj.the_map.removeAllAnnotations(); /* * Add Map Tray */ central_object.removeMapTray(parent_obj); central_object.addMapTray("", parent_obj, ""); /* * Add the Service tray */ central_object.removeServiceTray(parent_obj); central_object.addServiceTray("", "", parent_obj); var the_pin = Ti.Map.createAnnotation({ title : name, latitude : location.lat, longitude : location.lng, image : dir_path.R + "images/location/orange_google_flag.png", animate : true }); parent_obj.the_map.addAnnotation(the_pin); var location_object = new Object(); location_object.lat = location.lat_centre; location_object.lng = location.lng_centre; central_object.centreMap(parent_obj.the_map, location_object, location.latDelta, location.lngDelta); }Now when I used the values fetched form the 'regionChanged' event in the 'location' object (in code) , the map rendered is not the same as what I saw on the screen.
How can I achieve this.
ps: The 'regionChanged' event seems to change the zoom. How can I prevent this?
Thanks in Advance.
1 Answer
Hi Steven
You have not included your code for the regionChanged so it is hard to work out what may be happening.
Also just for clarity you understand that
latitudeDelta : zoom_lat, longitudeDelta : zoom_longControl the 'zoom' but in fact they are really just distances in both axis? (Not trying to teach you to suck eggs - just want to make sure we are both on the same page).
Your Answer
Think you can help? Login to answer this question!