B4J Question jGoogleMaps PolyLine: zoom-change affecting line location

ansoUzr

Member
Licensed User
Longtime User
I've been trying out the B4J GoogleMapsExample from the forum - I downloaded it, added my API Key and it worked. I then added the following Forum code to the Example to test AddPolyLine:

B4X:
    Dim l1, l2, l3 As LatLng
    l1.Initialize(20, 20)
    l2.Initialize(25, 25)
    l3.Initialize(30, 20)
    gmap.AddPolyline(Array (l1, l2, l3), 4, fx.Colors.Red)

and the line is drawn as expected. I also have a Marker from the Example code. However, if I change the zoom level, the polyline moves to a different lat long location, which moves further from the actual location as I zoom out. Note, the Marker 'stays' in the original lat long location. Moreover, if I change the window size, the line stays in the correct location.

I've searched the forum, but haven't seen anything about this behavior. (I have a similar B4A app on my phone that works fine: the line stays in the appropriate lat long location with zoom-level change.)

Any help to keep the added line at the correct lat long with zoom-level change would be greatly appreciated.

William
 

ansoUzr

Member
Licensed User
Longtime User
While continuing my web search on the Polyline behavior, I came across a couple of Visual Basic articles on "mapping." Based on the articles, I put together a test program, which turned out to be all I needed. No more line location problems when changing the zoom level. In fact, the Visual Basic Gmap libraries are very useful and may have given me some insights into what's going on with the B4J program. I'm setting aside the B4J effort for the meantime.
 
Upvote 0
Top