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.

1. 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

2. If you are using a local Mac builder then you need to first download the SDK to your Mac computer: www.b4x.com/b4i/files/GoogleMaps.framework.zip (download it from your Mac).
And copy GoogleMaps.framework package to the Libs folder.

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:
3. Add these two attributes to your project (if you want to show the user location):
B4X:
#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.
4. Set the minimum version to 11:
B4X:
#MinVersion: 11

5. 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:

- GoogleMaps iOS SDK v6.0.1 was uploaded to the builders.
Make sure to update Files\Special\GoogleMaps.bundle from the example project.
If using a local Mac then update the Mac frameworks (see step #2 above)
Set the minimum version to 11: #MinVersion: 11
 
Last edited:

ciginfo

Well-Known Member
Licensed User
Longtime User
With the new B41-Bridge it works.
I have set Timeout on 45 '' for more security. But it shows only the markers and not map in background. Is it normal??
I have tried to change and set my ApiKey, (PrivateApiKeyAsString = "AIzaSyA-xxxxxxxxxx"), it is the same thing., no map.
 

ciginfo

Well-Known Member
Licensed User
Longtime User
it is the attached project that does not work. No map on the background.
I suppose I have not to change the two attributes (#PlistExtra) or the ApiKey, and the GoogleMaps.bundle folder is in the attached project.
Is there an other manipulation to do? I think I follow correctly the steps in the first post.
 

MikeH

Well-Known Member
Licensed User
Longtime User
Is it possible to reposition the compass?
 

ciginfo

Well-Known Member
Licensed User
Longtime User
Problem solved.
Yes it was a mistake on my part. I put the name of the app example instead of the name of m'y app. I put com.ciginfo.exemple instead com.ciginfo.kindabreak associated to my google apikey. Desolated.
 

tucano2000

Active Member
Licensed User
Longtime User
Why the camera 's zoom level shows up to 17 MAP_TYPE_TERRAIN ?

I put values greater than 17 but the image shown on the map zoom remains 17 .

This is very little because I can not see the name of every street.

In version android it does not.
 

Shay

Well-Known Member
Licensed User
Longtime User
I am getting white screen with the markers, instead of the map
I checked the API key is my API key taken from: Key for iOS apps (with bundle identifiers)
also made sure to write my app name under iOS apps on google console
also installed latest google maps app
any idea? (sounds like API key, but it is ok)
 

Shay

Well-Known Member
Licensed User
Longtime User
log was referring to issue with API key
I deleted it and created new one
now it is ok, Thanks
 

yonson

Active Member
Licensed User
Longtime User
the zoom level is maximum currently to 20 as I understand, which isn't enough for my app maps. Can you explain why this is limited in such a way, and when an update will be available which will allow a higher level of zoom?
Thanks
 

yonson

Active Member
Licensed User
Longtime User
ah apologies I thought it was a restriction on the library. Thanks for clarifying.
 
Status
Not open for further replies.
Top