Android Open Source - advanced-tourist-map Poi Overlay Item






From Project

Back to project page advanced-tourist-map.

License

The source code is released under:

GNU General Public License

If you think the Android project advanced-tourist-map listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package org.muxe.advancedtouristmap.overlay;
//w  ww  .  j a v  a2 s .c  om
import org.mapsforge.android.maps.GeoPoint;
import org.mapsforge.poi.PointOfInterest;
import org.muxe.advancedtouristmap.PositionInfo;

import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.drawable.Drawable;

public class PoiOverlayItem extends GenericOverlayItem {

  private PointOfInterest poi;

  public PoiOverlayItem(PointOfInterest poi) {
    super();
    this.setPoi(poi);
  }

  public PoiOverlayItem(PointOfInterest poi, String title, String snippet,
      Drawable marker) {
    super(new GeoPoint(poi.getLatitude(), poi.getLongitude()), title,
        snippet, marker);
    this.setPoi(poi);
  }

  public PoiOverlayItem(PointOfInterest poi, String title, String snippet) {
    super(new GeoPoint(poi.getLatitude(), poi.getLongitude()), title,
        snippet);
    this.setPoi(poi);
  }

  public void setPoi(PointOfInterest poi) {
    this.poi = poi;
  }

  public PointOfInterest getPoi() {
    return this.poi;
  }

  @Override
  public void onTap(final Context context) {
    Builder builder = new AlertDialog.Builder(context);
    builder.setIcon(android.R.drawable.ic_menu_info_details);
    builder.setTitle(this.getTitle());
    builder.setMessage(this.getSnippet());
    builder.setPositiveButton("OK", null);
    builder.setNeutralButton("Info", new DialogInterface.OnClickListener() {
      @Override
      public void onClick(DialogInterface dialog, int which) {
        context.startActivity(new Intent(context, PositionInfo.class)
            .putExtra(PositionInfo.LATITUDE_EXTRA,
                poi.getLatitude()).putExtra(
                PositionInfo.LONGITUDE_EXTRA,
                poi.getLongitude()));
      }
    });
    builder.show();
  }
}




Java Source Code List

org.mapsforge.geocoding.Unchecked.java
org.mapsforge.geocoding.widget.CityCompletionAdapter.java
org.mapsforge.geocoding.widget.PlaceCompletionAdapter.java
org.mapsforge.geocoding.widget.RoadCompletionAdapter.java
org.mapsforge.geocoding.widget.RoadListAdapter.java
org.mapsforge.geocoding.widget.SqliteCompletionAdapter.java
org.mapsforge.geocoding.widget.State.java
org.muxe.advancedtouristmap.AdvancedTouristMapApplication.java
org.muxe.advancedtouristmap.AdvancedTouristMap.java
org.muxe.advancedtouristmap.BaseActivity.java
org.muxe.advancedtouristmap.CacheSizePreference.java
org.muxe.advancedtouristmap.EditPreferences.java
org.muxe.advancedtouristmap.FilePickerIconAdapter.java
org.muxe.advancedtouristmap.FilePicker.java
org.muxe.advancedtouristmap.InfoView.java
org.muxe.advancedtouristmap.LocationPicker.java
org.muxe.advancedtouristmap.MoveSpeedPreference.java
org.muxe.advancedtouristmap.PositionInfo.java
org.muxe.advancedtouristmap.Search.java
org.muxe.advancedtouristmap.SeekBarPreference.java
org.muxe.advancedtouristmap.Utility.java
org.muxe.advancedtouristmap.overlay.GenericOverlayItem.java
org.muxe.advancedtouristmap.overlay.GenericOverlay.java
org.muxe.advancedtouristmap.overlay.PoiOverlayItem.java
org.muxe.advancedtouristmap.overlay.PositionOverlayItem.java
org.muxe.advancedtouristmap.overlay.WikiOverlayItem.java
org.muxe.advancedtouristmap.poi.PoiBrowserActivity.java
org.muxe.advancedtouristmap.poi.PoiOrCategory.java
org.muxe.advancedtouristmap.routing.AngleCalc.java
org.muxe.advancedtouristmap.routing.DecisionOverlay.java
org.muxe.advancedtouristmap.routing.DecisionPoint.java
org.muxe.advancedtouristmap.routing.RouteCalculator.java
org.muxe.advancedtouristmap.routing.RouteList.java
org.muxe.advancedtouristmap.routing.Route.java
org.muxe.advancedtouristmap.sourcefiles.AddressFile.java
org.muxe.advancedtouristmap.sourcefiles.FileManagerActivity.java
org.muxe.advancedtouristmap.sourcefiles.FileManager.java
org.muxe.advancedtouristmap.sourcefiles.MapBundle.java
org.muxe.advancedtouristmap.sourcefiles.MapFile.java
org.muxe.advancedtouristmap.sourcefiles.PoiFile.java
org.muxe.advancedtouristmap.sourcefiles.RoutingFile.java
org.muxe.advancedtouristmap.sourcefiles.SourceFile.java
org.muxe.advancedtouristmap.wikipedia.AbstractWikiArticle.java
org.muxe.advancedtouristmap.wikipedia.ArticleRetrieverFactory.java
org.muxe.advancedtouristmap.wikipedia.ArticleRetriever.java
org.muxe.advancedtouristmap.wikipedia.GeonamesRetriever.java
org.muxe.advancedtouristmap.wikipedia.OnlineWikiArticle.java
org.muxe.advancedtouristmap.wikipedia.WikiArticleInterface.java
org.muxe.advancedtouristmap.wikipedia.WikilocationRetriever.java