[ALOY-1608] Not possible to add elements on ti.map through alloy
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | None |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 7.0.0 |
Fix Version/s | n/a |
Components | Titanium SDK |
Labels | n/a |
Reporter | Rene Pot |
Assignee | Bruce Wayne |
Created | 2018-03-05T17:25:28.000+0000 |
Updated | 2018-03-06T12:16:07.000+0000 |
Description
When adding a circle to ti.map using Alloy the code generated/compiled is incorrect as it calls the wrong method to add a circle to the map.
Sample XML:
<Module method="createView" module="ti.map" id="mapview" onClick="handleMapClick">
<Annotation id="amsterdam"></Annotation>
<Annotation id="appcHQ"></Annotation>
<Module module="ti.map" method="createCircle" id="mapCircle" />
</Module>
The same result was using
<Circle module="ti.map" />
This is compiled into
$.__views.mapCircle = (require("ti.map").createCircle || Ti.UI.createCircle)({
center : {
latitude : 37.368122,
longitude : -122.213653
},
radius : 500,
fillColor : "#ff0000",
strokeColor : "#000000",
strokeWidth : 2,
annotations : __alloyId196,
id : "mapCircle"
});
$.__views.mapview.add($.__views.mapCircle);
There are 2 problems:
1) annotations shouldn't be added to the view
2) circle should be added to the map using addCircle
*This problem also exists with other methods, like polygons, polylines and routes.*
*Expected result*
Compiled code should use the addCircle/addPolygon/addRoute methods.
*Or!* circles, polygons polycircles and annotations should be added-able by using the _add()_ method.
No comments