Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User lifenlim88's Avatar
    Join Date
    Feb 2010
    Posts
    3
    hi,

    i am trying out Google API.

    I have an error that says "(003) GPS Error: 1016 undefined". When it enters to a Callback function. It does not have any error with using the emulator. However once it is deployed in a real phone, the error prompts. How do go about solving the error?
    Thanks!!

    function setup()
    {

    so = device.getServiceObject("Service.Location", "ILocation");

    }

    function getLocation() {
    try {

    var updateoptions = new Object();
    updateoptions.PartialUpdates = false;

    var criteria = new Object();
    criteria.LocationInformationClass = "GenericLocationInfo";
    criteria.Updateoptions = updateoptions;

    var result = so.ILocation.GetLocation(criteria, callbackLocation);

    var errCode = result.ErrorCode;
    if(errCode) {
    alert("(005) GPS Error: " + errCode + " " + result.ErrorMessage);
    }
    }
    catch (e) {
    alert ("(004) ::getLocation error: " + e);
    }
    }



    //Callback function
    function callbackLocation(transId, eventCode, result)
    {
    var errCode = result.ErrorCode;
    if (errCode) {
    alert("(003) GPS Error: " + errCode + " "+result.ErrorMessage);
    }
    else {
    //succuess result
    }
    }


    regards,
    lifenlim

  2. #2
    Nokia Developer Moderator isalento's Avatar
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    831
    That error code would suggest that request has timed out. criteria.Updateoptions.UpdateTimeOut has default value of 15 seconds. Try to increase this a bit. You could also try to go outdoors to get GPS fix faster.

    Err: 1016 Service timed-out

    -Ilkka

  3. #3
    Registered User lifenlim88's Avatar
    Join Date
    Feb 2010
    Posts
    3
    Hi again,

    Thanks for the reply!

    I'm quite new to this. How do i go about increasing the UpdateTimeOut? Is there any sample code/solution for this?



    regards,
    lifenlim

  4. #4
    Nokia Developer Moderator isalento's Avatar
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    831
    You can set the timeout value in updateoption object:

    Code:
    var updateoptions = new Object();
    updateoptions.PartialUpdates = false;
    updateoptions.UpdateTimeOut = 60000000;  //60 000 000 microseconds = 1 minute
    UpdateTimeOut is given as microseconds.
    http://library.forum.nokia.com/topic...1C4378307.html

    Br,
    Ilkka

  5. #5
    Registered User lifenlim88's Avatar
    Join Date
    Feb 2010
    Posts
    3
    Hey! Thanks! It's working already!

    I have 2 other queries here...

    I did a function that plots the origin to destination on the map.

    1)It runs smoothly with the map and the directions on how to travel. But on the map, it only shows the destination. What must i do to make both my destination and origin show in the map?

    2)However sometimes it prompts for the error "ERROR UNKNOWN." Is it because it can't locate the place?


    function guideAddressTOHOME(){

    var directionsRenderer = new google.maps.DirectionsRenderer();
    directionsRenderer.setMap(map);
    directionsRenderer.setPanel(document.getElementById('directionsPanel'));

    var directionsService = new google.maps.DirectionsService();
    var request = {
    //latitude,longitude
    origin: new google.maps.LatLng (latitude, longitude),
    destination: homeaddress,
    travelMode: google.maps.DirectionsTravelMode.DRIVING,
    unitSystem: google.maps.DirectionsUnitSystem.METRIC,
    provideTripAlternatives: false
    };
    directionsService.route(request, function(response, status){
    if (status == google.maps.DirectionsStatus.OK) {
    directionsRenderer.setDirections(response);
    }
    else {
    alert('Error: ' + status);
    }
    });
    }

    regards,
    lifenlim

Similar Threads

  1. Route in Google Static MAP API
    By eling0167 in forum Geolocation and Navigation
    Replies: 6
    Last Post: 2011-11-17, 08:35
  2. Google Maps API - Map download does not work
    By snowisfree in forum Mobile Java General
    Replies: 4
    Last Post: 2009-03-12, 12:10
  3. Google Maps using Location Api
    By Burim in forum Symbian C++
    Replies: 1
    Last Post: 2008-08-10, 18:32
  4. PC Suite error: (Code: Init IMediaControl2) HELP?!
    By chunkyspudmonkey in forum General Development Questions
    Replies: 29
    Last Post: 2008-06-30, 11:47
  5. S60 API Partnering Program
    By Nokia Ron in forum News, Announcements and Job Listings
    Replies: 9
    Last Post: 2008-04-16, 18:28

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved