Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Flip Transition removes map annotation -IOS

$
0
0

I am trying to have a mapView and a tableView flip transition. when the window loads it shows the map, adds the pins all is good, when I click the Tableview button, it transitions flip_left to tableview, when I go back to the map, the pins don't get re-added. How can i get the view to reload the pins on transition? Here is a code snippet:

var view = Ti.UI.createView({
            backgroundColor: 'black',
            top: 1,
            bottom: 50,
            width: Ti.Platform.displayCaps.platformWidth,
            height: Ti.UI.FILL
        });
 
masterViewContainer.add(view);
 
// add the mapView js file to main view, 1st run
var theMapView = require('/ui/window/theMapView');
        _themapView = new theMapView();
view.add(_themapView);
 
var state = true;
        var changed = true;
        buttonChangeState.addEventListener('click', function(e) {
 
    switch (state) {
                case true:
            var tableView = require('/ui/window/tableView');
                        var view2 = new tableView();
 
            buttonChangeState.title = 'List View';
            view.animate({
                               view: view2,
                               transition: Ti.UI.iPhone.AnimationStyle.FLIP_FROM_RIGHT
                        });
        break;
        case false:
 
 
                    var theMapView = require('/ui/window/theMapView');
                _themapView = new theMapView();
 
                    view.add(_themapView);
                    //img.image = '/images/list_bullets.png';
                    buttonChangeState.title = 'Map View';
 
                    view.animate({
                        view: _themapView,
                        modal: true,
                        transition: Ti.UI.iPhone.AnimationStyle.FLIP_FROM_LEFT
                    });
                    break;
            }
            state = !state;
});
In the mapview file I have a function called CreatePins(); which get the the pin data from a remote db.

Not sure how to reload the map when it transition back from the tableview.

Thanks for your help!

Titanium SDK version 3.5.0.RC iOS - 8


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>