I'm catching a location using the following code below and is showing Error 1016. Does anyone know if I have to put something in my code, because in 5530 it works perfectly.
The code:
var serviceObj = null;
window.onload = init;
// Initializes the widget
function init() {
// Obtain the Location service object
try {
serviceObj = device.getServiceObject("Service.Location", "ILocation");
} catch (ex) {
alert("Service object cannot be found.");
return;
}
// We are interested in basic location information (longitude, latitude
// and altitude) only, so let's define the criteria respectively
var criteria = new Object();
criteria.LocationInformationClass = "BasicLocationInformation";
// Obtain the location information (synchronous)
var result = serviceObj.ILocation.GetLocation(criteria);
var latitude = result.ReturnValue.Latitude;
var longitude = result.ReturnValue.Longitude;
// Display the location
alert("Lat. " + latitude + ", Long. " + longitude);
}
Thank you.

Reply With Quote

