[TIMOB-12582] iOS: Adding custom views in the pin
| GitHub Issue | n/a |
|---|---|
| Type | New Feature |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2013-03-23T16:23:39.000+0000 |
| Affected Version/s | Release 3.0.0 |
| Fix Version/s | Release 3.1.0, 2013 Sprint 04 API, 2013 Sprint 04 |
| Components | iOS |
| Labels | api, module_map, qe-testadded |
| Reporter | Mauro Parra-Miranda |
| Assignee | Vishal Duggal |
| Created | 2013-02-05T02:17:59.000+0000 |
| Updated | 2014-06-19T12:43:48.000+0000 |
Description
Feature Description
Customer wants to be able to use any view in as the custom pin instead of having to convert the view into a blob.Extra info
Customer have the feeling that this will do the entire process more efficient (memory and time wise) and easy (to code).Attachments
| File | Date | Size |
|---|---|---|
| pin.jpg | 2013-02-05T02:21:09.000+0000 | 94015 |
This is the kind of feature the customer wants to implements.
Test Case
var win = Titanium.UI.createWindow(); var myView1 = Ti.UI.createView({ width:Ti.UI.SIZE, height:Ti.UI.SIZE, backgroundColor:'red', layout:'vertical' }); var label = Ti.UI.createLabel({ text:" $400K ", font:{fontSize:14, fontWeight:"bold", fontStyle:"italic"} }) var clickHandler = function(e){ Ti.API.info('Custom View CLICKED'); } label.addEventListener('click',clickHandler) myView1.add(label) var mountainView = Titanium.Map.createAnnotation({ latitude:37.390749, longitude:-122.081651, title:"Appcelerator Headquarters", subtitle:'Mountain View, CA', pincolor:Titanium.Map.ANNOTATION_RED, customView:myView1, animate:true, leftButton: 'images/atlanta.jpg', myid:1 // Custom property to uniquely identify this annotation. }); var mapview = Titanium.Map.createView({ mapType: Titanium.Map.STANDARD_TYPE, region: {latitude:37.390749, longitude:-122.081651, latitudeDelta:0.01, longitudeDelta:0.01}, animate:true, regionFit:true, userLocation:true, annotations:[mountainView], top:0, height:'80%' }); win.add(mapview); // Handle click events on any annotations on this map. mapview.addEventListener('click', function(evt) { Ti.API.info("Annotation " + evt.title + " clicked, id: " + evt.annotation.myid); // Check for all of the possible names that clicksouce // can report for the left button/view. if (evt.clicksource == 'leftButton' || evt.clicksource == 'leftPane' || evt.clicksource == 'leftView') { Ti.API.info("Annotation " + evt.title + ", left button clicked."); } }); var b1 = Ti.UI.createButton({ title:'Add Text', left:0, bottom:0 }) win.add(b1); b1.addEventListener('click',function(){ var l = Ti.UI.createLabel({text:'More Text',font:{fontSize:14, fontWeight:"bold", fontStyle:"italic"}}); l.addEventListener('click',clickHandler); myView1.add(l); }) win.open();Pull pending against master https://github.com/appcelerator/titanium_mobile/pull/3887
CR & FR
Tested with: SDK:3.1.0.v20130306004750 Studio: 3.1.0.201302252142 Device:iOS simulator
Reopening the bug as Custom View is not behaving as expected. tested on : Device: Samsung Galaxy Note, Android version: 2.3.6 SDK: 3.1.0.v20130322171500 CLI version : 3.0.25-alpha OS : MAC OSX 10.7.5 Steps to reproduce: 1) Run TIMOB-12582 under map module 2) Click on "Add Text" button at bottom left of the screen. Expected: 1) Should see a map with a view as annotation having text "$400k". 2) The text "more text" should be added to the view each time "add text" is clicked. Actual: Annotation Text is :Appcelerator HeadQuarters, Mountain View , CA Clicking on 'Add Text' button, nothing happens
[~pmishra] h3.this is an iOS feature -NOT ANDROID test on iphone not android.
Seems we have a QE test that is not limiting itself to iOS. We can fix that. Closing.