welcome to linkAR technical documentation

next previous

Panoramio POIs


Lets look at the loadData method in ARViewActivity.

private void loadData() {
  //1
  aRbrowserView.removeAllpoisFromList();
  //2
  if (ActualPosition.getInstance(this).getLoc() != null) {
    aRbrowserView.setMyCurrentLocation(ActualPosition.getInstance(this)
	.getLoc());
    //3
    for (POI_Json poi : JsonDataParse.arrayListPoiJson) {
      //4
      POI mPoi;
      mPoi = new POI();
      mPoi.setIconBitmap(poi.getPhoto());
      mPoi.setLatitude(poi.getLatitude());
      mPoi.setLongitude(poi.getLongitude());
 
      POIlabel label = new POIlabel();
      label.setLabelTitle(poi.getPhoto_title());
      mPoi.setPoiLabelProperty(label);
      //5
      POIaction action = new POIaction();
 
      action.setEmailAction("emailID", getApplicationContext()
          .getResources().getString(R.string.watchimage)
          + " "
          + poi.getPhoto_title(), "emailMessage");
 
      mPoi.addPoiActionToList(action);
 
      action = new POIaction();
 
      action.setTwitterAction(getApplicationContext().getResources()
			        .getString(R.string.watchimage)
			        + " "
			        + poi.getPhoto_title());
 
      mPoi.addPoiActionToList(action);
 
      action = new POIaction();
      action.setMapDirectionAction(true);
 
      mPoi.addPoiActionToList(action);
 
 
      //6
      aRbrowserView.addPoiToRenderList(mPoi);
    }
    //7
    aRbrowserView.ResumeArView();
  }
}
  1. Removes previous POIs
  2. Ensures there is a valid user coordinate and then sets it.
  3. For every panoramio image, do 4, 5 and 6.
  4. Initialize a POI, sets its image and position.
  5. Adds actions to the POI
  6. Adds the POI to the ARbrowser.
  7. Starts the ARbrowser (Main thread).

next previous