Jigglyfish / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 0 forks source link

MapController animate and setcenter - multiple bugs #204

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I've multiple bugs when using animateto:

a) 
mapController.animateTo(loc_home,AnimationType.EXPONENTIALDECELERATING,255,10000
);
This works but you only see a gray grid. 
That's actually a pretty slow animation and the tiles were all cached.
It looks like the map is not able to load the tiles before they are displayed 
and so it shows a gray grid all the time until the animation stops. There 
should be at least a low resolution image being animated, but a gray grid looks 
cheap.

b)
mapController.animateTo(loc_home);
This does -> nothing <- if setzoom is not called BEFORE issuing the command.

c)
mapController.animateTo(loc_home,AnimationType.LINEAR);
Using a linear animation type does nothing, the animation does not start

d)
mapController.setCenter(loc_home);
if setZoom is not issued before this function call then it does not seem to do 
anything.

Original issue reported on code.google.com by nol...@gmail.com on 13 Apr 2011 at 3:59

GoogleCodeExporter commented 8 years ago
I'd like to add that the animation does actually not even hit the right target.

Example used:
            mapController.setZoom(14);
mapController.animateTo(loc_home,MapController.AnimationType.EXPONENTIALDECELERA
TING,MapController.ANIMATION_SMOOTHNESS_DEFAULT,1500);

This always finds a wrong location, it's "close" to the right one but 10-30 km 
away.

Same code, same startup etc:
mapController.setZoom(14);
mapController.setCenter(loc_home);

This centers on the location correctly.

Original comment by nol...@gmail.com on 13 Apr 2011 at 4:31

GoogleCodeExporter commented 8 years ago
This is related to issue 202. The animateTo causes a call to 
MapView.setZoomLevel at the end of the animation, and the calculation of the 
center is wrong when it's zooming in.

However, there are some other issues as well. One would think that setting the 
zoom level and then animating to a location should result in the same result as 
visa versa. And with Google Maps it is indeed this case. However, with 
osmdroid, I've had to reverse all calls to set the Zoom first, then the 
animateTo. I'm still investigating this.

Original comment by polar.hu...@gmail.com on 17 Apr 2011 at 8:39

GoogleCodeExporter commented 8 years ago

Original comment by neilboyd on 18 Apr 2011 at 5:27

GoogleCodeExporter commented 8 years ago
Problem:
It seems to me that if you call animateTo(p) right at the application launch, 
it gives me a fairly random location.

Reason may be: 
the animation timeouts as the starting location is random (likely to be 1000+ 
kms?)

Workaround:
When I used setCenter(p) instead, it worked ok.

(The same code worked ok with Google maps, now testing with OSMdroid.)

Original comment by Teemu.P...@gmail.com on 4 May 2011 at 1:23

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
This may be related to Issue 230

Original comment by kurtzm...@gmail.com on 16 Jun 2011 at 8:25

GoogleCodeExporter commented 8 years ago
Have the same problem. But setCenter(geoPoint) doesn't work either. Even with a 
setZoom call before.

Original comment by rui.mtd....@gmail.com on 25 Aug 2011 at 10:52

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Haha! Got a pretty ugly workaround:

new Handler().postDelayed(new Runnable() {
    @Override
    public void run() {
        mapController.animateTo(geoPoint);
    }
}, 200);

This will bypass the initialization time issues. The 200ms works for me, but...

Original comment by rui.mtd....@gmail.com on 25 Aug 2011 at 11:00

GoogleCodeExporter commented 8 years ago
Have same issues.

If i'm using this code

mapController.animateTo(center);
mapController.zoomToSpan(spanLatDelta, spanLngDelta);

center will be faraway from this point. But if i'll swap lines - everything 
fine.

mapController.zoomToSpan(spanLatDelta, spanLngDelta);
mapController.animateTo(center);

Original comment by ydan...@googlemail.com on 25 Jan 2012 at 6:02