Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12582] iOS: Adding custom views in the pin

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-03-23T16:23:39.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sRelease 3.1.0, 2013 Sprint 04 API, 2013 Sprint 04
ComponentsiOS
Labelsapi, module_map, qe-testadded
ReporterMauro Parra-Miranda
AssigneeVishal Duggal
Created2013-02-05T02:17:59.000+0000
Updated2014-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

FileDateSize
pin.jpg2013-02-05T02:21:09.000+000094015

Comments

  1. Mauro Parra-Miranda 2013-02-05

    This is the kind of feature the customer wants to implements.
  2. Vishal Duggal 2013-02-15

    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();
       
  3. Vishal Duggal 2013-02-15

    Pull pending against master https://github.com/appcelerator/titanium_mobile/pull/3887
  4. Sabil Rahim 2013-02-25

    CR & FR
  5. Anshu Mittal 2013-03-07

    Tested with: SDK:3.1.0.v20130306004750 Studio: 3.1.0.201302252142 Device:iOS simulator
  6. Paras Mishra 2013-03-23

    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
  7. Sabil Rahim 2013-03-23

    [~pmishra] h3.this is an iOS feature -NOT ANDROID test on iphone not android.
  8. Eric Merriman 2013-03-30

    Seems we have a QE test that is not limiting itself to iOS. We can fix that. Closing.

JSON Source