Android Open Source - GeoAlarms Point Overlay






From Project

Back to project page GeoAlarms.

License

The source code is released under:

GNU General Public License

If you think the Android project GeoAlarms 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 com.geoalarms.map;
//w  ww  .jav a 2s.  c om
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Point;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
import com.google.android.maps.Projection;

public class PointOverlay extends Overlay {
  GeoPoint point = null;

  public PointOverlay(GeoPoint p) {
    this.point = p;
  }

  @Override
  public void draw(Canvas canvas, MapView mapView, boolean shadow) {
    Projection projection = mapView.getProjection();

    if (shadow == false) {
      // get point
      Point center = new Point();
      projection.toPixels(this.point, center);

      // paint 
      Paint p = new Paint();
      p.setColor(Color.BLUE);

      canvas.drawCircle(center.x, center.y, 5, p);
      //canvas.drawText("lat:" + (int) point.getLatitudeE6() + "long" + point.getLongitudeE6(), center.x + 10, center.y + 5, p);
    }
  }
}




Java Source Code List

com.geoalarms.GeoAlarms.java
com.geoalarms.activity.AlarmEditor.java
com.geoalarms.activity.AlarmList.java
com.geoalarms.activity.Help.java
com.geoalarms.activity.Home.java
com.geoalarms.activity.Map.java
com.geoalarms.activity.Preferences.java
com.geoalarms.database.AlarmDatabaseHelper.java
com.geoalarms.database.AlarmManager.java
com.geoalarms.location.LocListener.java
com.geoalarms.location.ProximityIntentReceiver.java
com.geoalarms.map.AlarmOverlay.java
com.geoalarms.map.PointOverlay.java
com.geoalarms.model.Alarm.java
com.geoalarms.model.Coordinates.java