×

Discussion Board

Results 1 to 6 of 6

Hybrid View

  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    2

    ILocation.Calculate() doesn't work anymore with Symbian Anna

    ILocation.Calculate() doesn't seem to work anymore.
    When I use "MoveCoordinates" it only returns integer values that are completely useless as geocoordinates.
    It worked properly before the update.

    "FindDistance" and "FindBearingTo" doesn't seem to work either but I didn't have time yet to figure that out completely.

    Is there any hint how to get it working again?

  2. #2
    Nokia Developer Moderator
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    833

    Re: ILocation.Calculate() doesn't work anymore with Symbian Anna

    Welcome to Forum!

    Could you tell what device you used to test it? (model, firmware version and browser version)

    I tested with N8 having Symbian Anna and it is definitely broken.

    FindDistance does not return error code but only returns 0 meters as as distance between two points.

    FindBearing Says that input parameters are bad (1002), but same code does work on emulator/older devices.

    Move behaves more interesting way. With my test data I could almost get the correct result, but not completely. Can you share source coordinate, distance & bearing you used in testing, to see if I could get it to return useless data as well?

    Br,
    Ilkka

  3. #3
    Registered User
    Join Date
    Jun 2009
    Posts
    2

    Re: ILocation.Calculate() doesn't work anymore with Symbian Anna

    Thanks for your reply!

    I'm also using an N8 with Anna.

    I found out, that all functions expecting coordinates as an argument don't work anymore. So "addLandmark" doesn't work either.
    It makes no difference if you are using Platformservices 1.0 (1.1) or 2.0. Nothing works.

    The exact problem is, that those functions parse an integer out of the given argument.
    So if you calculate the distance between (49.123 | 7.123) and (49.456 | 7.456) it only calculates the distance between (49 | 7) and (49 | 7) and that is zero (0 meters).

    The same with "addLandmark": I want to save a landmark at (49.123 | 7.123) but it only saves (49 | 7). That's what I called useless integer values.

    So the key question is, how to provide the arguments in a way the functions accept them.

    Hope someone can help.

    Regards
    Benjamin

  4. #4
    Registered User
    Join Date
    Dec 2007
    Posts
    3

    Re: ILocation.Calculate() doesn't work anymore with Symbian Anna

    I have the same problem. Is it solved or answered in any way?

  5. #5
    Nokia Developer Champion
    Join Date
    Feb 2011
    Location
    bucharest
    Posts
    148

    Re: ILocation.Calculate() doesn't work anymore with Symbian Anna

    yes, same here...

    I calculate the distance like this:
    Code:
    	var R = 6371; // km
    	var dLat = (LAT-LAT0)*Math.PI/180;
    	var dLon = (LNG-LNG0)*Math.PI/180;
    	var lat1 = LAT0*Math.PI/180;
    	var lat2 = LAT*Math.PI/180;
    	var a = Math.sin(dLat*.5) * Math.sin(dLat*.5) + Math.sin(dLon*.5) * Math.sin(dLon*.5) * Math.cos(lat1) * Math.cos(lat2); 
    	var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); 
    	var d = R * c;
    	return d*1000;
    where the 2 points are at this coords: LAT,LON and LAT0,LON0

    Quote Originally Posted by b.butz View Post
    ILocation.Calculate() doesn't seem to work anymore.
    When I use "MoveCoordinates" it only returns integer values that are completely useless as geocoordinates.
    It worked properly before the update.

    "FindDistance" and "FindBearingTo" doesn't seem to work either but I didn't have time yet to figure that out completely.

    Is there any hint how to get it working again?

  6. #6
    Nokia Developer Moderator
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    833

    Re: ILocation.Calculate() doesn't work anymore with Symbian Anna

    Hi,
    I’m sorry to inform you that, ILocation.Calculate() issue has been analyzed, but unfortunately it will not be fixed as WRT is no longer in active development. As a workaround I would suggest using a pure JavaScript implementation to calculate the distance between two points.

    Code:
    /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
    /*  Latitude/longitude spherical geodesy formulae & scripts (c) Chris Veness 2002-2009            */
    /*	http://www.movable-type.co.uk/scripts/latlong.html											  */  
    /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
    	
    function distHaversine(lat1, lon1, lat2, lon2) {
    	  var R = 6371; // earth's mean radius in km
    	  var dLat = toRad(lat2-lat1);
    	  var dLon = toRad(lon2-lon1);
    	  lat1 = toRad(lat1), lat2 = toRad(lat2);
    	
    	  var a = Math.sin(dLat/2) * Math.sin(dLat/2) +  Math.cos(lat1) * Math.cos(lat2) * Math.sin(dLon/2) * Math.sin(dLon/2);
    	  var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
    	  var d = R * c;
    	  return d;
    	  
    	}
    	
    	// extend Number object with methods for converting degrees/radians
    	
    	function toRad (deg) {  // convert degrees to radians
    	  return deg * Math.PI / 180;
    	}
    You can also check Location API simulation file in C:\Program Files (x86)\Nokia Web Tools 1.2.0\Web App Simulator\platformservices\api\wrt11\Location.js to see how bearing can be calculated.

    edit:
    Ps.
    Thanks Shpe for the snippet. I should have refreshed the page before posting

    Br,
    Ilkka

Similar Threads

  1. Replies: 4
    Last Post: 2011-07-13, 11:28
  2. Symbian Signed doesn't work!
    By infine in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 1
    Last Post: 2011-05-16, 12:07
  3. Drawpixels on 7650 doesn't work anymore since firmware update
    By jtranchant in forum Mobile Java General
    Replies: 0
    Last Post: 2003-02-04, 15:09
  4. Replies: 2
    Last Post: 2002-07-05, 07:35

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •