Is it possible to click on a marker on a B4i generated Google Map and cause a B4XPage to display? In other words, can an event be generated with a marker click that can be intercepted and contain information to allow me to open a page? These markers are placed with the Lat and Lon that is stored in the customer record in the SQLIte database. I could place a record pointer in the marker snippet, for example, and use string slicing to get the record pointer and use the result to open the matching customer record page. In my primary business web site I do something similar with the Google Maps javascript API generated map and then use an ajax call embeded in the map to contact the web server to do specific tasks. Of course I know these are apples and oranges but capturing a map marker click event in iOS is the start.
I figured out how to do this. I modified the "gmap_MarkerClick" sub from the GoggleMapsExtra example as shown below:
B4X:
Sub gmap_MarkerClick (SelectedMarker As Marker)
Dim RecordID As Int = SelectedMarker.Title
Dim CustomerFound As Boolean = False
Dim RS1 As ResultSet = Main.SQL1.ExecQuery("SELECT * FROM " & Main.CustomerTable & " WHERE customer_number = " & RecordID)
Do While RS1.NextRow
CustomerFound = True
Main.MasterCustomerNumber = RS1.GetString("ID")
Loop
RS1.Close
If CustomerFound = True Then
B4XPages.ShowPage("CustomerRecord")
End If
End Sub
I just set the marker title to the record ID when creating the markers for the map. Works great.
Hey b4a community may i know how can i create such amazing ui as attached below?The filter screen just popup from bottom of the screen as shown below in the figure.
Since I've seen a lot of downloads on my previous tutorial HERE I've decided to write another nice looking (and hopefully useful) custom view written in 100% B4A, and I also hope you guys learn something or at least inspire you a little bit. What this view does?, well, it's very simple, is a...