0

I have some trouble while sending coordinates form a kml file to my emulator. For example I'm sending long: 13,428753 lat: 52,518823 and I receive: 13.428751666666669and 52.51882166666666

When creating markers on a GoogleMap with these coordinates I receive a marker with a slightly different position but this breaks comparisons between LatLng object. Any ideas how I can fix this? I can provide more information if needed.

How I receive my data:

@Override
    public void onLocationChanged(Location location) {  
        if(CurrentJourney.getInstance().getJourney() == null) {
            return;
        }

        CurrentJourney.getInstance().getJourney().getCoordinates()
            .add(new LatLng (location.getLatitude(), location.getLongitude()));

        String latitude = String.valueOf(location.getLatitude());
        String longitude = String.valueOf(location.getLongitude());

        Intent intent = new Intent(ACTION_NEW_LOCATION);
        intent.putExtra(EXTRA_NEW_LATITUDE, latitude);
        intent.putExtra(EXTRA_NEW_LONGITUDE, longitude);
        sendBroadcast(intent);
    }
soupdiver
  • 3,504
  • 9
  • 40
  • 68
  • Seems like you're using `float` instead of `double` for the coordinates. – Anne Feb 24 '13 at 16:14
  • Yeah I already guessed something like this but I don't store the coordinates somewhere as a float. I also added my receiver code – soupdiver Feb 24 '13 at 16:19

0 Answers0