umarmansuri / android-augment-reality-framework

Automatically exported from code.google.com/p/android-augment-reality-framework
GNU General Public License v3.0
0 stars 0 forks source link

Markers not updated properly #13

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In my activity i get all markers for my locations and calls 
ARData.addMarkers(cachedMarkers);

This works perfect. If i had location 1 at 500 meters, it shows that
Now i go back from my activity. I move to a a new location 2 kms away.

i open the activity again. it gets the marker info and call addMarkers.
Now what i see is that, it shows location1 again at 500 metres instead of 2.5 
kms.

I think it is because of the code 

 public static void addMarkers(Collection<Marker> markers) {
        ...
...
        for(Marker marker : markers) {
            if (!markerList.containsKey(marker.getName())) {
                marker.calcRelativePosition(ARData.getCurrentLocation());
                markerList.put(marker.getName(),marker);
            }

        }

If name already there, we do not add marker again. But will this logic work ?
When we move to a new location, the existing marker should be removed and new 
one added with updated data ?Shouldnt the markerList recreated each time AR 
activity is loaded ?

Thanks a lot for your help.

Original issue reported on code.google.com by preetha...@gmail.com on 17 Sep 2012 at 11:10

GoogleCodeExporter commented 8 years ago
Can you plese confirm this point

Original comment by preetha...@gmail.com on 18 Sep 2012 at 7:52

GoogleCodeExporter commented 8 years ago
Well, Markers are supposed to change positions. They are generally physical 
places which don't move.

If you physically move, marker.calcRelativePosition is called onLocationChanged 
in SensorsActivity.

It's likely your GPS position has updated yet.

Original comment by phishman3579@gmail.com on 7 Jan 2013 at 8:57