Refine search
class MapOverlay extends com.google.android.maps.Overlay { public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) { super.draw(canvas, mapView, shadow); //---translate the GeoPoint to screen pixels--- Point screenPts = new Point(); mapView.getProjection().toPixels(p, screenPts); //---add the marker--- Bitmap bmp = BitmapFactory.decodeResource( getResources(), R.drawable.pink); canvas.drawBitmap(bmp, screenPts.x, screenPts.y-32, null); return true; } }
GeoPoint gP2 = new GeoPoint(37423157, -122085008); Point p1 = new Point(); Point p2 = new Point(); Path path = new Path(); Projection projection=mapv.getProjection(); projection.toPixels(gP1, p1); projection.toPixels(gP2, p2);
Projection projection = mapV.getProjection(); Point pt = new Point(); projection.toPixels(globalGeoPoint,pt); Point pt2 = new Point(); projection.toPixels(newGeos,pt2); float circleRadius = Math.abs(pt2.y-pt.y);
Projection projection = mapView.getProjection(); if (shadow == false && _points != null) { Point startPoint = null, endPoint = null; Point pointA = new Point(); projection.toPixels(gPointA, pointA); if (i == 0) { //This is the start point
Point screenPts = new Point(); mapView.getProjection().toPixels(p, screenPts);
(Canvas canvas, MapView mapView, boolean shadow, long when) Projection projection = mapView.getProjection(); if (shadow == false) Point point = new Point(); projection.toPixels(gp1, point); else paint.setColor(defaultColor); Point point2 = new Point(); projection.toPixels(gp2, point2); paint.setStrokeWidth(5);
@Override public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) { super.draw(canvas, mapView, shadow); Point screenPts = new Point(); mapView.getProjection().toPixels(p, screenPts); for(int i=0;i<markerList.size();i++) { canvas.drawBitmapbmp(markerList.get(i), screenPts.x + 25, screenPts.y - 50,null); } return false; }
public void draw(android.graphics.Canvas canvas, MapView mapView, boolean shadow) { // our marker bitmap already includes shadow. // centerPoint is the geopoint where we need to put the marker. if (!shadow) { Point point = new Point(); mapView.getProjection().toPixels(centerPoint, point); canvas.drawBitmap(markerBitmap, point.x, point.y, null); } }
private void drawFreeMarker(Canvas canvas, MapView mapView, boolean shadow) { Point screenPts = new Point(); mapView.getProjection().toPixels(tempPoint, screenPts); //---add the marker--- Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.bluepin_38); canvas.drawBitmap(bmp, screenPts.x-((xCurLocOffset/2)-1), screenPts.y-(yCurLocOffset-1), null); }
@Override public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) { super.draw(canvas, mapView, shadow); // convert point to pixels Point screenPts = new Point(); mapView.getProjection().toPixels(pointToDraw, screenPts); // add marker Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.marker); canvas.drawBitmap(bmp, screenPts.x, screenPts.y - 24, null); // 24 is the height of image return true; } }
public void draw(Canvas canvas, MapView mapView, boolean Shadow){ Point screenPts = new Point(); mapView.getProjection().toPixels(markerPoint, screenPts); //---add the marker--- Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.cur_loc_1); canvas.drawBitmap(bmp, screenPts.x-(xCurLocOffset), screenPts.y-yCurLocOffset, null); }
private void drawFreeMarker(Canvas canvas, MapView mapView, boolean shadow) { Point screenPts = new Point(); mapView.getProjection().toPixels(tempPoint, screenPts); //---add the marker--- Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.bluepin_38); canvas.drawBitmap(bmp, screenPts.x, screenPts.y, null); }
@Override public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) { if (!shadow) { super.draw(canvas, mapView, shadow); // ---translate the GeoPoint to screen pixels--- Point screenPts = new Point(); mapView.getProjection().toPixels(geoPnt, screenPts); // ---add the marker--- Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.pushpin); canvas.drawBitmap(bmp, screenPts.x, screenPts.y - 67, null); } return true; } }
private void drawPath(MapView mv, Canvas canvas) { int x1 = -1; int y1 = -1; int x2 = -1; int y2 = -1; Point point = new Point(); for (int i=0; i < list.size(); i++) { mv.getProjection().toPixels(list.get(i), point); x2 = point.x; y2 = point.y; if (i > 0) { canvas.drawLine(x1, y1, x2, y2, paint); } x1 = x2; y1 = y2; }
public boolean onTouchEvent(MotionEvent event, MapView mv) { final int action=event.getAction(); final int x=(int)event.getX(); final int y=(int)event.getY(); if(!this.marker.equals(getResources().getDrawable(R.drawable.parada))){ if (action == MotionEvent.ACTION_DOWN) { for (OverlayItem item : mItems) { Point p = new Point(0,0); mv.getProjection().toPixels(item.getPoint(), p); if (hitTest(item, marker, x-p.x, y-p.y) && item.getSnippet()!= "parada") {
public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) { super.draw(canvas, mapView, shadow); // -- array of points--- if(bump!=null){ for(int i = 0; i < bump.length; i++) { Point screenPts99 = new Point(); mapView.getProjection().toPixels(p99[i], screenPts99); Bitmap bmp99 = BitmapFactory.decodeResource( getResources(), R.drawable.redpin); canvas.drawBitmap(bmp99, screenPts99.x, screenPts99.y-44, null); } } return true; }
class MapOverlay extends com.google.android.maps.Overlay { @Override public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) { super.draw(canvas, mapView, shadow); //---translate the GeoPoint to screen pixels--- Point screenPts = new Point(); mapView.getProjection().toPixels(p, screenPts); //---add the marker--- Bitmap bmp = BitmapFactory.decodeResource( getResources(), R.drawable.my_bubble); canvas.drawBitmap(bmp, screenPts.x, screenPts.y-50, null); return true; } }
class MarkerOverlay extends Overlay{ private GeoPoint p; public MarkerOverlay(GeoPoint p){ this.p = p; } @Override public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when){ super.draw(canvas, mapView, shadow); //---translate the GeoPoint to screen pixels--- Point screenPts = new Point(); mapView.getProjection().toPixels(p, screenPts); //---add the marker--- Bitmap bmp = BitmapFactory.decodeResource(getResources(), /*marker image*/); canvas.drawBitmap(bmp, screenPts.x, screenPts.y-50, null); return true; } }
class MapOverlay extends com.google.android.maps.Overlay { @Override public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) { super.draw(canvas, mapView, shadow); //---translate the GeoPoint to screen pixels--- Point screenPts = new Point(); mapView.getProjection().toPixels(carloc, screenPts); //---add the marker--- Bitmap bmp = BitmapFactory.decodeResource( getResources(), R.drawable.marker); canvas.drawBitmap(bmp, screenPts.x, screenPts.y-50, null); return true; } }
public void draw(Canvas canvas, MapView mapView, boolean shadow) { if(shadow){ return; } super.draw(canvas, mapView, shadow); // convert bitmap's bounding box into pixels Point top_left = new Point(); mapView.getProjection().toPixels(topLeft, top_left); Point bottom_right = new Point(); mapView.getProjection().toPixels(bottomRight, bottom_right); // Prepare two rectangles (pixels) Rect src = new Rect( 0,0,bmp.getWidth() - 1, bmp.getHeight() - 1 ); Rect dst = new Rect( top_left.x, top_left.y, bottom_right.x,bottom_right.y ); // draw bitmap canvas.drawBitmap(bmp, src, dst, null); }