iOS Tutorial GoogleMaps Tutorial

Status
Not open for further replies.
The iGoogleMaps library allows you to show a map inside your app:

SS-2014-11-17_09.18.50.png


It is similar to B4A GoogleMaps library.

In order to use it you need to get a free api key from Google. Follow the "Obtaining an API Key" steps: https://developers.google.com/maps/documentation/ios/start#obtaining_an_api_key
Start with the attached project. You will need to change the package name.

When you are ready to start a new project you need to:
Add these two attributes to your project (if you want to show the user location):
Code: Copy
#PlistExtra:<key>NSLocationWhenInUseUsageDescription</key><string>Used to display the current navigation data.</string>
#PlistExtra:<key>NSLocationUsageDescription</key><string>Used to display the current navigation data.</string>
You can change the description text.

Copy the GoogleMaps.bundle folder from the example project (under Files\Special) to Files\Special in your project.

You can download the example project from: https://www.b4x.com/b4i/files/GoogleMaps.zip

Updates:

- Example updated with B4i v10+ and Google Maps v10.4.0 requirements. The bundle was updated.
 
Last edited:
When you say copy GoogleMaps.Framework under macserver-aa/libs

will I see macserver-aa/Libs/GoogleMaps.Framework when done?
 
Last edited:
I looked at the googlemaps example and saw the plist items were inserted in the project section of the code
 
Last edited:
I created the "Key for iOS apps (with bundle identifiers)"

Build Configurations
Configuration Name=Default
Package: anywhere software.b4i.googlemaps

Code: Copy
PrivateApiKeyAsString = "AIzaSyA-xxxxxxxxxx"

In the googlemaps demo code

I get a grey screen with no map. (Resolved)

It is working
I changed the version number and iTunes updated the code then the map display.
Great Job
 
Last edited:
How do I add a google Map to a tab controller Page?

I need to load google maps into a panel on my frmPage4 Layout.

Code: Copy
gmap.Initialize("gmap", ApiKey)

    'Page4.RootPanel.AddView(gmap, 0, 0, 100%X, 100%y)

    panelMap.AddView(gmap, 0, 0, 100%X, 100%y)

    gmap.MapType = gmap.MAP_TYPE_TERRAIN

    gmap.GetUiSettings.CompassEnabled = True

    gmap.GetUiSettings.MyLocationButtonEnabled = True

    gmap.MyLocationEnabled = True

The app crashes when using this code.
 
Last edited:
the error message is "Google Maps SDK for iOS to be part of your target under "Copy Bundle Resources""

I forgot to "Copy the GoogleMaps.bundle folder from the example project (under Files\Special) to Files\Special in your project."

I copied the "GoogleMaps.bundle" from sample data. Is that the correct process
 
Last edited:
What is the procedure if no one uses local Mac builder but hosted builder?
Thank you
 
In B4A, it is possible to set 'showinfowindow' on true or false. This is usefull to update the infowindow, if the title or the snippet has changed. Is it possoble in B4i to update an markers infowindow, during the infowindow is shown?
 
Yes, I have tested it. In b4a and b4i, it is not possible to update an open marker-window.
 
Impossible to test the attached project GoogleMaps. I have changed the package name to "com.ciginfo.maps"
Below the 2 last lines of the error message

"Sending data to remote compiler. Error
Le thread a été abandonné."
 
It appears 25 or 30 seconds after
 

Attachments

  • error.png
    error.png
    24.3 KB · Views: 1,530
Status
Not open for further replies.

Similar Threads

Replies
13
Views
6K
  • Article Article
Android Code Snippet [B4X] Custom GoogleMaps
Replies
13
Views
10K
  • Locked
  • Article Article
Replies
39
Views
31K
Back
Top