开发者

Map View errors when I used it for the second time in Android (Titanium)

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜