Titanium JIRA Archive
Alloy (ALOY)

[ALOY-694] Add support for Google Maps v2 add-on module

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionDuplicate
Resolution Date2013-10-02T17:43:09.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 20
Componentsn/a
Labelsn/a
ReporterTim Poulsen
AssigneeTony Lukasavage
Created2013-06-07T21:12:29.000+0000
Updated2014-06-22T13:21:31.000+0000

Description

As a developer, I would like to be able to use Alloy views and styles when adding maps to my Android app that implement the Google Maps v2 add-on module. I understand that I would still need to manually perform the other required steps for using this module (obtaining the API key and updating my tiapp.xml). But I'd like to use the tag as with Ti.Map so that I can add a map to my cross-platform app without doing the iOS map in XML and the Android map in the controller. Looking at the currently generated code:
  $.__views.map = Ti.Map.createView({
could be replaced with something like:
  $.__mapmodule = require('ti.map');
  $.__views.map = $.__mapmodule.createView({
There are platform-specific attributes, which can be handled with the existing platform-handling features in styles.

Enabling the Google Maps API v2 module

Full explanation is at http://goo.gl/EBozL (Maps v2 guide) In a nutshell, you must:

Obtain an API key from Google

1. Get the SHA-1 fingerprint from your keystore 2. Visit https://code.google.com/apis/console/ 3. Click Create Project or select project name, click Create 4. In list of services, turn on Google Maps Android API v2 5. Accept the terms of service 6. Click API Access, then click Create New Android Key 7. Paste in your SHA-1 fingerprint followed by a semicolon followed by your app's App ID 8. Note the resulting "Key for Android Apps (with certificates)" -- that's your API key

Update tiapp.xml with your Key

1. Visit http://goo.gl/EBozL (Maps v2 guide) 2. Scroll to find "Obtain and Add a Google API Key" 3. Copy the manifest XML code sample and paste into your tiapp.xml 4. Paste your API key where indicated in that sample code 5. Replace the two instances with your app's App ID

Comments

  1. Tony Lukasavage 2013-09-30

    Android v2 maps can be used in markup as detailed in ALOY-817

JSON Source