Uploaded image for project: 'Alloy'
  1. Alloy
  2. ALOY-800

Add support for <Annotation> within <Module module="ti.map" method="createView" platform="android">

    Details

      Description

      I would like to be able to add annotations to Android maps using the <Annotation> tag, and style them with the CSS. This will require a small change to store a reference to either the ti.map module or Ti.Map, for Android and iOS respectively.

      Given this XML:

      <!-- index.xml -->
      <View ns="Ti.Map" id="map" platform="ios">
        <!-- annotation styled via tss file -->
        <Annotation id="annotation1"/>
      </View>
      <Module id="map" module="ti.map" method="createView" platform="android">
        <Annotation id="annotation1"/>
      </Module>
      

      The generated code would need to create a reference to the appropriate module, like this:

      /* Pseudo-code of the generated Resources/alloy/controllers/index.js */
      // need a reference to the map module
      $.__mapModule = (OS_ANDROID) require("ti.map") : Ti.Map;
      // rest is pretty much the same, just using the map reference rather than Ti.Map explicitly
      $.__views.map = $.__mapModule.createView({
          region: {
              latitude: 37.38,
              latitudeDelta: .2,
              longitude: -122.05,
              longitudeDelta: .2
          },
          id: "map"
      });
      $.__views.win.add($.__views.map);
      $.__views.annotation1 = $.__mapModule.createAnnotation({
          title: "Mountain View",
          latitude: 37.389569,
          longitude: -122.050212,
          id: "annotation1"
      });
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                skypanther Tim Poulsen
                Reporter:
                skypanther Tim Poulsen
              • Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Integration