views:

27

answers:

0

Hi

I have records on the table list contains data that has latitude & longitude on the listing widow. When I click on each row, it passes to the detail window that display the mapview and its annotation of that record.

I zoom in & out, moved to different area and I clicked "back" button to go back to the record list.

Then, I selected on the different record to see the map on the detail window again, when I'm on the detail window suddenly I clicked on the map, there, it alerts me an error message which did not mention about the specific issues.

Here is my code:

        self.listingAnnotation = Titanium.Map.createAnnotation({
            pincolor: Titanium.Map.ANNOTATION_RED,
            latitude: latitude,
            longitude: longitude,
            animate: true
        });

        self.region = {
                latitude: latitude,
                longitude: longitude
        };

        if(!self._mapview){
            self._mapview = Titanium.Map.createView({
                top: 130,
                bottom: 0,
                animate:true,
                mapType: Titanium.Map.STANDARD_TYPE,
                region: {latitude: latitude, longitude: longitude},
                annotations: [self.listingAnnotation]
            }); 
        }
        else{
            self._mapview.removeAllAnnotations();
            self._mapview.setLocation(self.region);
            self._mapview.addAnnotation(self.listingAnnotation);
        }

        self._listingDetailWindow.add(self._mapview);