[ALOY-800] Add support for <Annotation> within <Module module="ti.map" method="createView" platform="android">
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-04-15T14:54:29.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Alloy 1.4.0, 2014 Sprint 08 |
Components | Titanium SDK, XML |
Labels | notable, qe-testadded |
Reporter | Tim Poulsen |
Assignee | Tim Poulsen |
Created | 2013-08-20T16:02:59.000+0000 |
Updated | 2014-05-13T23:03:45.000+0000 |
Description
I would like to be able to add annotations to Android maps using the
<!-- 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
File | Date | Size |
---|---|---|
MapsDemo.zip | 2014-02-13T17:03:43.000+0000 | 3702940 |