Android Question Googlemap Zoom

Terradrones

Active Member
Licensed User
Hi All

I need a hint again please.

When I plot a TIN Model (Triangles) on Googlemap, I find that there is a limit on far I can Zoom in. It looks like it's a Factor of about 25.

When I plot the Contours as well, I need to be able to Zoom in close to enable me to select the correct side of a Triangle that needs to be swapped, in case the Contours are not drawn correctly.

Is there a way to bypass this limit?

B4X:
[/
#Region ************************************************** Plot PolyLines ***************************************************************

Sub Open_TinTable
    CGlobals.CreateOtherTables
End Sub

Sub PlotPoly
    Wait For TopoMap1_Ready
    Gmap = TopoMap1.GetMap
    If Gmap.IsInitialized Then
        Gmap.MapType=Gmap.MAP_TYPE_NORMAL
        rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCATION)
        Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
        If Result Then
            Gmap.MyLocationEnabled = True
        Else
            Log("No permission!")
        End If
        Gmap.GetUiSettings.AllGesturesEnabled = True
        Gmap.clear
        PlotPolyLines(0)
    End If
End Sub

Sub PlotPolyLines(A As Int)
    Dim line As Polyline
    Dim points As List
    Dim Point As LatLng
    line=Gmap.AddPolyline
    points.Initialize
    
    line.color=Colors.Red 'Array As Int(255,255,255)
    line.Geodesic=True
    line.Visible =True
    line.Width=2
    
    Open_TinTable
    AveY=0
    AveX=0
    i=0
    
    Data.Initialize
    Try
        Dim rs As ResultSet = CGlobals.sql1.ExecQuery("SELECT No, East1, North1, Elevation1, East2, North2, Elevation2, East3, North3, Elevation3, Area FROM Tin")
        Do While rs.NextRow
            Dim row(6) As Object
            row(0) = NumberFormat2(rs.GetDouble("East1"),1,3,3,False)
            row(1) = NumberFormat2(rs.GetDouble("North1"),1,3,3,False)
            Geo.get_point_From_local(row(0),row(1))

            Point.Initialize(Engine.Lon,Engine.Lat)
            points.Add(Point)
            AveY=AveY + row(0)
            AveX=AveX + row(1)
            i=i+1
    
            row(2) = NumberFormat2(rs.GetDouble("East2"),1,3,3,False)
            row(3) = NumberFormat2(rs.GetDouble("North2"),1,3,3,False)
            Geo.get_point_From_local(row(2),row(3))

            Point.Initialize(Engine.Lon,Engine.Lat)
            points.Add(Point)
            AveY=AveY + row(2)
            AveX=AveX + row(3)
            i=i+1
            
            row(4) = NumberFormat2(rs.GetDouble("East3"),1,3,3,False)
            row(5) = NumberFormat2(rs.GetDouble("North3"),1,3,3,False)
            Geo.get_point_From_local(row(4),row(5))

            Point.Initialize(Engine.Lon,Engine.Lat)
            points.Add(Point)
            AveY=AveY + row(4)
            AveX=AveX + row(5)
            i=i+1
            
            line.Points=points
        Loop
        rs.Close
        AveY=AveY/i
        AveX=AveX/i
        If (AveY<>0 Or AveX<>0) And A=0 Then
            'Zoom in to center of points
            CenterPolyMap
        End If
    Catch
        Log(LastException)
    End Try
End Sub

Sub CenterPolyMap
    Try
        Geo.get_point_From_local(AveY,AveX)
        cp.Initialize(Engine.Lon,Engine.Lat,ZoomSize)
        Gmap.MoveCamera(cp)
    Catch
        Log(LastException)
    End Try
End Sub

Sub APoly_Click
    CenterPolyMap
End Sub

Sub ZoomPoly_SelectedIndexChanged (Index As Int)
    ZoomSize =ZoomPoly.cmbBox.SelectedItem
    CenterPolyMap
End Sub

#End Region
]

I call it "ZoomSize"
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…