Hello everyone, I had my issue of passing ACS data for strings fixed from one screen to another. I tried using the same format to pass the latitude and longitude (which are numbers/integers) on ACS from a place to the next window and it's failing miserably. Here is what I have so far:
Main Window
mapButt(pizzaLocations[i].map); function mapButt (latitude, longitude){ var mapButt = Ti.UI.createButton({ title : 'map', backgroundImage : 'mapButt.png', color : '#262524', width : 55, height : 35, top : 50, left : 140, borderColor : '#262524', borderRadius : 1 }); row.add(mapButt); mapButt.addEventListener('click', function(latitude, longitude){ var titleHell = pizzaLocations[index].name; var pizzaAddress = pizzaLocations[index].address; var pizzaLong = pizzaLocations[index].lon; var pizzaLat = pizzaLocations[index].lat; var pizzaCoor = pizzaLocations[index].custom_fields.coordinates; var mapView = Ti.UI.createWindow({ //backgroundImage:'Background-Screen.png', backgroundColor:'#000', barImage:'topBar.png', barColor:'red', longitude:pizzaLong, latitude:pizzaLat, text:titleHell, name:pizzaAddress, latitude:pizzaLat, //coordinates:pizzaCoor, orientationModes: [Titanium.UI.PORTRAIT], url:'ui/common/MapView.js' }); //Ti.App.Properties.setInt(longitude, pizzaLong); //Ti.App.Properties.setInt(latitude, pizzaLat); navGroup.open(mapView); }); }; // end mapButt function
MapView.js
var win = Titanium.UI.currentWindow; var Cloud = require('ti.cloud'); var pizzaView = require('ui/common/PizzaView'); //var pizzaLat = getLatitude(); //var pizzaLat = getInt(pizzaLat); //var pizzaLong = getInt(pizzaLong); //Ti.API.info(Ti.App.Properties.getInt(pizzaLong,pizzaLat)); //Titanium.Geolocation.distanceFilter = 10; //set the mapview with the current location var annotation = Titanium.Map.createAnnotation({ // var pizzaLat = Titanium.app.properties.getstring("value"), latitude:win.getPizzaLat(), longitude:getPizzaLong(), title:win.getText(), subtitle:win.getName(), animate:true // leftButton:'/images/atlanta.jpg', // image:"/images/boston_college.png" }); alert(latitude, longitude); /*var pizzaCoord = {latitude:latitude,longitude:longitude,latitudeDelta:0.010, longitudeDelta:0.018}; var mapview = Titanium.Map.createView({ mapType: Titanium.Map.STANDARD_TYPE, animate:true, region: pizzaCoord, regionFit:true, userLocation:true, visible: true, annotations:[annotation] }); var route = { name:"pizzaCoord", points:points, color:"red", width:4 }; mapview.addRoute(route); win.add(mapview); /*function getLocation(){ //Get the current position and set it to the mapview Titanium.Geolocation.getCurrentPosition(function(e){ var region={ latitude: e.coords.latitude, longitude: e.coords.longitude, animate:true, latitudeDelta:0.001, longitudeDelta:0.001 }; mapview.setLocation(region); }); } */ //win.add(mapview); //Titanium.Geolocation.addEventListener('location',function(){ // getLocation(); //});