Android Question Google Maps route: how to zoom on it?

Facilauto Juan

Member
Licensed User
Longtime User
Hello there!

I have my route drawn in my Google Map Api v2 view. I'm using a line with multiple points.

The problem is that I want to zoom in to that route and I don't know how. I want to zoom to the point that all the route is shown in the screen.

Is this possible?

Thanks for your answers and your time.
 

Facilauto Juan

Member
Licensed User
Longtime User
I have used it, but it throws me this error:


B4X:
** Activity (main) Create, isFirst = true **


** Activity (main) Resume **


MapFragment1_Ready


Cannot get methods of class: uk.co.martinpearman.b4a.googlemapsextras.GoogleMapsExtras, disabling cache.


Error occurred on line: 98 (main)


java.lang.RuntimeException: Method: AnimateToBounds not found in: uk.co.martinpearman.b4a.googlemapsextras.GoogleMapsExtras


    at anywheresoftware.b4a.shell.Shell$MethodCache.getMethod(Shell.java:735)
    at anywheresoftware.b4a.shell.Shell.getMethod(Shell.java:398)
    at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:517)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:235)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:174)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:93)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:158)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:154)
    at anywheresoftware.b4a.objects.MapFragmentWrapper$1.onCameraChange(MapFragmentWrapper.java:141)
    at com.google.android.gms.maps.GoogleMap$2.onCameraChange(Unknown Source)
    at com.google.android.gms.internal.cn$a.onTransact(Unknown Source)


    at android.os.Binder.transact(Binder.java)
    at cmq.a(SourceFile:93)
    at maps.af.q.a(Unknown Source)
    at maps.af.r.run(Unknown Source)
    at android.os.Handler.handleCallback(Handler.java)
    at android.os.Handler.dispatchMessage(Handler.java)
    at android.os.Looper.loop(Looper.java)
    at android.app.ActivityThread.main(ActivityThread.java)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)
    at dalvik.system.NativeStart.main(Native Method)
 
Upvote 0

warwound

Expert
Licensed User
Longtime User
Upvote 0

warwound

Expert
Licensed User
Longtime User
It happens because one of the methods in this library requires a higher version of Android.

@warwound, you can fix it by changing the problematic method to signature to a "safe" signature. Which means that it doesn't expose any unavailable type.

@Erel
Can you explain that in a bit more detail?
(What is the unavailable type?)

Is the user likely to be using an old version of the Google Play Services library?
Is this error only related to rapid debugging mode or can it occur at other times?

Martin.
 
Upvote 0
Top