B4A Library GoogleMapsExtras

GoogleMapsExtras is an ongoing project to implement more of the Google Maps Android v2 classes in Basic4Android.

Currently the library allows you to create these objects:

Tutorials for each object will be uploaded to the Google Maps Android v2 tutorial thread.

Martin.
 

Attachments

  • GoogleMapsExtras_v1_71.zip
    59.6 KB · Views: 2,866
  • MapsForgeTileProvider_v1.01.zip
    173.1 KB · Views: 2,747
  • GoogleMapsExtras_v2_0_library_files.zip
    82.5 KB · Views: 3,166
Last edited:

Spectre

Active Member
Licensed User
Longtime User
Does this distance need to be 'road distance' or could it be 'as the crow flies' distance?
If 'as the crow flies' distance is acceptable then you could simply use the Location object's DistanceTo method to get the distance instead of performing a query to a web service.
You'd need to initialize a Location object for both start point and end point.

HI!
the problem is this: I have to enter an alert on the track.
For example, a point where the road is interrupted.
But I want to make sure that I am not too far from the track.
So the problem is that I can not control the distance only to start or end track ..
 

MbedAndroid

Well-Known Member
Licensed User
Longtime User
i already gone through this part of the forum, but it seems not to possible to add a marker when touching google maps?
i dont see a member setOnClickListerner as part of googlemaps, even dont know it's possible to read the lat/lon position of the point touched to create a marker on that place
If someone knows a anwers it is highly appreciated.
 

warwound

Expert
Licensed User
Longtime User
i already gone through this part of the forum, but it seems not to possible to add a marker when touching google maps?
i dont see a member setOnClickListerner as part of googlemaps, even dont know it's possible to read the lat/lon position of the point touched to create a marker on that place
If someone knows a anwers it is highly appreciated.

Look at the MapFragment event Click(Point As LatLng).
Add a Sub that listens for this event.
 

iCAB

Well-Known Member
Licensed User
Longtime User
Hi Guys

I am new to the maps thing, so I do have a very basic question. Is there anything that I can use with this library that will provide the same functionality as:
B4X:
MapView1.SetZoomEnabled(True)

what are the advantages of each: MapView vs GoogleMapsExtras

Thanks in advance
 

Croïd

Active Member
Licensed User
Longtime User
Hello Warwound

for information, with updated play services 27 customlocationsource crash
 

arnold steger

Member
Licensed User
Longtime User
im using SnapshotReady for thake a snapshot.
i have a problem when want make this automatically after zoom at a location.
I still incompletely loaded fields.
how can read the state that loading map completely?
 

trueboss323

Active Member
Licensed User
Longtime User
My app seems to crash everytime it uses the fusedlocationprovider:

B4X:
java.lang.NoSuchMethodError: com.google.android.gms.common.api.GoogleApiClient.connect
 

iCAB

Well-Known Member
Licensed User
Longtime User
Hi All

Can you please tell me why this code generates an exception.
B4X:
Sub Map_Ready
   Log("map ready")
   gmap = mFragment.GetMap

   gmap.MyLocationEnabled = True
   GMapUISettings = gmap.GetUiSettings

   GMapUISettings.ZoomControlsEnabled = True
   GMapUISettings.CompassEnabled = True
   GMapUISettings.MyLocationButtonEnabled = True
   gmap.MapType = gmap.MAP_TYPE_NORMAL


    GoogleMapsExtras1.SetTrafficEnabled(gmap, True)
    gmap.GetUiSettings.AllGesturesEnabled = True
 
    gmap.MyLocationEnabled = True
 
    Dim markerDragListener As OnMarkerDragListener
    markerDragListener.Initialize("markerDragListener")
    GoogleMapsExtras1.SetOnMarkerDragListener(gmap,markerDragListener) 
 
    gmap.MyLocationEnabled  = True
    Dim OnMyLocationButtonClickListener1 As OnMyLocationButtonClickListener
    OnMyLocationButtonClickListener1.Initialize("OnMyLocationButtonClickListener1")
 
'This line generated an exception: java.lang.RuntimeException: Object should first be initialized (OnMyLocationButtonClickListener)
    GoogleMapsExtras1.SetOnMyLocationButtonClickListener(gmap,OnMyLocationButtonClickListener1)
 
End Sub

Sub OnMyLocationButtonClickListener1_Click
 
    Log("Success!")
End Sub
 
Last edited:

Brian Robinson

Active Member
Licensed User
Longtime User
Hi, I was really impressed with the Maps Utils Demo.

Are you still looking to work on the Clustering utility in this library. It looked awesome in the demo and I would love to include that in my app.

Cheers
Brian
 

warwound

Expert
Licensed User
Longtime User
Hi All

Can you please tell me why this code generates an exception.
B4X:
Sub Map_Ready
   Log("map ready")
   gmap = mFragment.GetMap

   gmap.MyLocationEnabled = True
   GMapUISettings = gmap.GetUiSettings

   GMapUISettings.ZoomControlsEnabled = True
   GMapUISettings.CompassEnabled = True
   GMapUISettings.MyLocationButtonEnabled = True
   gmap.MapType = gmap.MAP_TYPE_NORMAL


    GoogleMapsExtras1.SetTrafficEnabled(gmap, True)
    gmap.GetUiSettings.AllGesturesEnabled = True
 
    gmap.MyLocationEnabled = True
 
    Dim markerDragListener As OnMarkerDragListener
    markerDragListener.Initialize("markerDragListener")
    GoogleMapsExtras1.SetOnMarkerDragListener(gmap,markerDragListener) 
 
    gmap.MyLocationEnabled  = True
    Dim OnMyLocationButtonClickListener1 As OnMyLocationButtonClickListener
    OnMyLocationButtonClickListener1.Initialize("OnMyLocationButtonClickListener1")
 
'This line generated an exception: java.lang.RuntimeException: Object should first be initialized (OnMyLocationButtonClickListener)
    GoogleMapsExtras1.SetOnMyLocationButtonClickListener(gmap,OnMyLocationButtonClickListener1)
 
End Sub

Sub OnMyLocationButtonClickListener1_Click
 
    Log("Success!")
End Sub

The OnMyLocationButtonClickListener Initialize method will fail if it cannot find the required callback sub(s).
If it fails to initialize then it'll display a warning in the log window.
In your posted code it looks as though you have the required callback sub - the 'Click' event handler.

Do you see any warning in the log window when you run this code?
 

warwound

Expert
Licensed User
Longtime User
Hi, I was really impressed with the Maps Utils Demo.

Are you still looking to work on the Clustering utility in this library. It looked awesome in the demo and I would love to include that in my app.

Cheers
Brian

I've been so busy with work over the past few months i spend hardly any time on b4a.
I've no idea if that'll change and i'll have more free time or whether my free time will be too limited to get any b4a stuff done :(.
 
Top