Dear All,
If I put Scroll gestures as enabled in the designer, then yes: I can scroll like I should. Then if I put it to disabled, it almost behaves as it should, but only almost: The location changes when zooming by pinching.
I´m not sure if there´s some sort of security breach if I´d post my google key here, which is why I´m not attaching a zip. Instead, here´s the code from Main, followed by a screenshot of the settings in designer. If you feel like reproducing the problem, you can see the numbers in the activity changes the more you zoom out with pinching. With +/- this is not a problem.
You can also see that the red circle changes position on the screen. In fact the circle stays where it is, covering the exact same area in pixels, but obviously the physical area in km changes when zoom changes. It´s the map that changes the position, making it look like the circle changes.
Any idea why this is happening?
If I put Scroll gestures as enabled in the designer, then yes: I can scroll like I should. Then if I put it to disabled, it almost behaves as it should, but only almost: The location changes when zooming by pinching.
I´m not sure if there´s some sort of security breach if I´d post my google key here, which is why I´m not attaching a zip. Instead, here´s the code from Main, followed by a screenshot of the settings in designer. If you feel like reproducing the problem, you can see the numbers in the activity changes the more you zoom out with pinching. With +/- this is not a problem.
You can also see that the red circle changes position on the screen. In fact the circle stays where it is, covering the exact same area in pixels, but obviously the physical area in km changes when zoom changes. It´s the map that changes the position, making it look like the circle changes.
B4X:
#Region Project Attributes
#ApplicationLabel: GoogleMapDemo
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#AdditionalJar: com.google.android.gms:play-services-maps
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
#BridgeLogger: true
Sub Process_Globals
End Sub
Sub Globals
Dim CameraUpdateFactory1 As CameraUpdateFactory
Dim CameraUpdate1 As CameraUpdate
Dim CameraPosition1 As CameraPosition
Dim staticradius As Float = 8
Dim zoomlevel As Float = 21
Dim Panel1 As Panel
Dim MapFragment1 As MapFragment
Dim GoogleMap1 As GoogleMap
Dim GoogleMapsExtras1 As GoogleMapsExtras
Dim MapPanel As Panel
Dim CircleOptions1 As CircleOptions
Dim Circle2 As Circle
Dim lat As Float = 52.7454476
Dim longi As Float = 8.736779
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
End Sub
Sub Mapfragment1_Camerachange(Position As CameraPosition)
Dim newzoom As Float = 16-(Position.zoom-7)
Dim radius As Float = Power(2,newzoom)
Activity.Title = Round2((newzoom-1),1) & " radius " & Round2(radius,1) & " LO " & Round2(Position.Target.Longitude,2) & " LA " & Round2(Position.Target.Latitude,2)
If Circle2.IsInitialized Then Circle2.Radius = radius
End Sub
Sub MapFragment1_Ready
GoogleMap1 = MapFragment1.GetMap
CircleOptions1.Initialize
CircleOptions1.Center2(lat, longi).FillColor(Colors.ARGB(128, 192, 0, 0)).Radius(staticradius).StrokeColor(Colors.Black).StrokeWidth(2)
Circle2=GoogleMapsExtras1.AddCircle(GoogleMap1, CircleOptions1)
CameraPosition1.Initialize(lat, longi, zoomlevel)
GoogleMap1.AnimateCamera(CameraPosition1)
End Sub
Any idea why this is happening?
Last edited: