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,853
  • MapsForgeTileProvider_v1.01.zip
    173.1 KB · Views: 2,733
  • GoogleMapsExtras_v2_0_library_files.zip
    82.5 KB · Views: 3,154
Last edited:

Brian Robinson

Active Member
Licensed User
Longtime User
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 :(.
Don't worry mate. I fully understand how life can be... And I am more than happy and really appreciative of what you have built already!

So cheers to you!
 

iCAB

Well-Known Member
Licensed User
Longtime User
Hi Warwound
Thanks for your reply to my post

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?


When I place a break point at this line
B4X:
    GoogleMapsExtras1.SetOnMyLocationButtonClickListener(gmap,OnMyLocationButtonClickListener1)

the following message appears in the log window

"OnMyLocationButtonClickListener not initialized, no event handling Sub found"

Am I doing something wrong in here ?
 

warwound

Expert
Licensed User
Longtime User
Am I doing something wrong in here

Guess so!
The log message says that GoogleMapsExtras cannot find a Sub that will handle the Click event.
So it fails to initialize.

Your posted code looks ok to me (but i just looked at it and didn't test it).
Look closely at the code you are compiling - does the OnMyLocationButtonClickListener event name plus "_Click" name a sub that exists?
 

iCAB

Well-Known Member
Licensed User
Longtime User
Hi Warwound

The sad part is that I think that the code is correct :(
If you look at my original post #318, you will see the code below

B4X:
Sub OnMyLocationButtonClickListener1_Click
    Log("Success!")
End Sub
 

Brian Robinson

Active Member
Licensed User
Longtime User
Hi Warwound

The sad part is that I think that the code is correct :(
If you look at my original post #318, you will see the code below

B4X:
Sub OnMyLocationButtonClickListener1_Click
    Log("Success!")
End Sub
Just a thought.

Have you tried moving the sub declaration above the call.

Cheers
Brian
 

Brian Robinson

Active Member
Licensed User
Longtime User
Brian, thanks for your input, but I have already tried that and didn't work.
Ok... Solved it... the sub has to end with "_MyLocationButtonClick", and not "_Click".

I had to create a Test app to be able to look into it and was busy releasing an app this afternoon, so sorry I took a while to get back to you.

It is handy to know that when you want to add an Event sub to know what the extension is you can type Sub followed by a space, and then when you hit the Tab button it will show you the options you have.

Cheers
Brian
 

iCAB

Well-Known Member
Licensed User
Longtime User
Brian, thanks again for taking the time to look into this for me.

I wish I knew about this long time ago:
It is handy to know that when you want to add an Event sub to know what the extension is you can type Sub followed by a space, and then when you hit the Tab button it will show you the options you have.

I have wasted a lot of time searching the forum for examples to find the correct Events extensions

Thanks for the great tip
 

warwound

Expert
Licensed User
Longtime User
@iCAB

There is an HTML reference document in the GoogleMapsExtras library download named GoogleMapsExtras.html which documents all library objects, methods, properties and event names.
Just open the HTML document in a browser.

I didn't notice that the event was "MyLocationButtonClick" and not just "Click" - well spotted @Brian Robinson!
 

iCAB

Well-Known Member
Licensed User
Longtime User
Hi Warwound

Thanks a lot. This is extremely helpful.
Now I can take full advantage of the library!!
By the way, well done.. works really nice
 

Raed Sabouneh

New Member
Licensed User
Longtime User
How can I remove the polygons i add using the below code:
Polygon1=GoogleMapsExtras1.AddPolygon(gmap, PolygonOptions1)

I used Polygon1.remove but nothing was removed!
 

marcick

Well-Known Member
Licensed User
Longtime User
B4X:
dim pp as list

pp.initialize
polygon1.points=pp

this should leave the polygon object but no longer visible.

Polygon1.remove also should work to definitely remove it
Try to post the sample code that give the error
 

Serdar K.

Member
Licensed User
Longtime User
Hello,

I would like to thank you for this useful and successful library, warwound.

I would like to inform you about one little issue, regarding to Erel's request.

I am getting a "Fatal signal 11 (SIGSEGV) at 0xfff0f0f0 (code=1)... " message in my application on "OnMarkerDragListener1_DragEnd" event (with an Android 4.1.2 device). It is random. Once in 3-4 executions , it happens and the app crashes without any B4A error message. I found out that this is related to the same issue on the keypress event reported in another post :
https://www.b4x.com/android/forum/threads/android-4-3-pb-with-closing-the-app.31328/#post-186702
I have found that the workaround which Erel suggested for the above issue works also fine with my issue.

My post and solution about it is on the link :
https://www.b4x.com/android/forum/threads/another-fatal-signal-11-sigsegv-issue.66840/#post-423373

Thanks again for the great work.

Regards,
Serdar
 

iCAB

Well-Known Member
Licensed User
Longtime User
Hi All

I have a map with Several Markers displayed.
When I display a polygon, the markers appear as if they are behind the polygon.
I tried setting the polygon ZIndex = 0 , but still getting the same results.
What is the best way to insure that the markers appear on top and not behind the polygon

Thanks in advance
 

marcick

Well-Known Member
Licensed User
Longtime User
Looking to my old code, when I draw a polyline, i set its zindex to 3. I suppose it was intended to let the polyline to be behind the marker.
Give it a try
 

warwound

Expert
Licensed User
Longtime User
I have a map with Several Markers displayed.
When I display a polygon, the markers appear as if they are behind the polygon.
I tried setting the polygon ZIndex = 0 , but still getting the same results.

0 might be the default z index for all overlay objects.
If that's true then you've given your polygons the same index as your markers.

Do as marcick suggested and experiment with different z index values - for both polygons and markers.
 

iCAB

Well-Known Member
Licensed User
Longtime User
Looking to my old code, when I draw a polyline, i set its zindex to 3. I suppose it was intended to let the polyline to be behind the marker.
Give it a try

I am setting Z-Index for the polygon to 0, to send it to the back based on Google documentation:
"The order in which this polygon is drawn with respect to other overlays, including Polylines, Circles,GroundOverlays and TileOverlays, but not Markers. An overlay with a larger z-index is drawn over overlays with smaller z-indices. The order of overlays with the same z-index value is arbitrary. The default is 0."

Do as marcick suggested and experiment with different z index values - for both polygons and markers.

I don't see Z-Index as a property for the Marker.

Thanks for your reply
 

marcick

Well-Known Member
Licensed User
Longtime User
Yes, but my polyline with zindex 3 is drawn behind markers. Try it ....
 
Top