Tabnine Logo
Projection.toPixels
Code IndexAdd Tabnine to your IDE (free)

How to use
toPixels
method
in
com.google.android.gms.maps.Projection

Best Java code snippets using com.google.android.gms.maps.Projection.toPixels (Showing top 20 results out of 315)

origin: stackoverflow.com

projection.toPixels(gP1, p1);
projection.toPixels(gP2, p2);
origin: stackoverflow.com

Projection projection = mapV.getProjection();
Point pt = new Point();
projection.toPixels(globalGeoPoint,pt);
projection.toPixels(newGeos,pt2);
float circleRadius = Math.abs(pt2.y-pt.y);
origin: stackoverflow.com

path.rewind();
final Iterator<GeoPoint> it = routePoints.iterator();
prj.toPixels(it.next(), p);
path.moveTo(p.x, p.y);
while (it.hasNext()) {
    prj.toPixels(it.next(), p);
    path.lineTo(p.x, p.y);
origin: stackoverflow.com

paint.setAntiAlias(true);
Point point = new Point();
projection.toPixels(gp1, point);
paint.setColor(Color.BLUE);
Point point2 = new Point();
projection.toPixels(gp2, point2);
paint.setStrokeWidth(2);
canvas.drawLine((float) point.x, (float) point.y, (float) point2.x,
origin: stackoverflow.com

GeoPoint gPointA = _points.get(i);
Point pointA = new Point();
projection.toPixels(gPointA, pointA);
if (i == 0) { //This is the start point
    startPoint = pointA;
origin: stackoverflow.com

paint.setAntiAlias(true);
Point point = new Point();
projection.toPixels(gp1, point);
  paint.setColor(defaultColor);
 Point point2 = new Point();
 projection.toPixels(gp2, point2);
 paint.setStrokeWidth(5);
 paint.setAlpha(120);
origin: stackoverflow.com

projection.toPixels(gP2, p2);
origin: stackoverflow.com

Point pt2 = new Point();
Projection projection = mapView.getProjection();
projection.toPixels(mGpt1, pt1);
projection.toPixels(mGpt2, pt2);
canvas.drawLine(pt1.x, pt1.y, pt2.x, pt2.y, paint);
return true;
origin: stackoverflow.com

paint.setAntiAlias(true);
Point point = new Point();
projection.toPixels(gp1, point);
paint.setColor(Color.BLUE);
Point point2 = new Point();
projection.toPixels(gp2, point2);
paint.setStrokeWidth(2);
canvas.drawLine((float) point.x, (float) point.y, (float) point2.x,(float) point2.y, paint);
origin: stackoverflow.com

 if(mapView != null){
  Projection projection = mapView.getProjection();
  if(projection != null){
     mScreenPoints = projection.toPixels(pointToDraw, mScreenPoints);
  }
  else{
   // log it projection is null
  }
}
else{
  //log it mapView is null
}
origin: stackoverflow.com

 public boolean onTap(GeoPoint p, MapView mapView) { 
 Projection projection = mapView.getProjection();
 projection.toPixels(yourMarkerGeopoint, pointTap);
 yourMarker.copyBounds(boundsTap);
 boundsTap.offset(pointTap.x, pointTap.y);
 projection.toPixels(geoPoint, pointTap);
 if(boundsTap.contains(pointTap.x, pointTap.y)){
  //you tap on the marker
  return true;
 }
 return false;
}
origin: stackoverflow.com

Projection projection = mapView.getProjection();
 Paint paint = new Paint();
 Point point = new Point();
 projection.toPixels(gp1, point);
 paint.setColor(color);
 Point point2 = new Point();
 projection.toPixels(gp2, point2);
origin: stackoverflow.com

 OverlayItem item = overlayItems_.get(index);
Projection projection = mMapView.getProjection();
  Point point = new Point();
  projection.toPixels(item.getPoint(), point);
  Toast toast = Toast.makeText(mContext, item.getTitle()+" "+item.getSnippet(), Toast.LENGTH_SHORT);
  toast.setGravity(Gravity.TOP | Gravity.LEFT, point.x, point.y);
  toast.show();
origin: stackoverflow.com

 float pisteX;
float pisteY;
Projection projection = this.mapView.getProjection(); 
Point pt = new Point();
GeoPoint gie = new GeoPoint(latitude,longitude);
Rect rec = mapView.getScreenRect(new Rect());
projection.toPixels(gie, pt);
pisteX = pt.x-rec.left; // car X screen coord
pisteY = pt.y-rec.top; // car Y screen coord
origin: stackoverflow.com

 public void draw(Canvas canvas, MapView mapView, boolean shadow){
    super.draw(canvas, mapView, shadow);
    path = new Path();
    Projection proj = mapView.getProjection();
    proj.toPixels(gp1, p1);
    proj.toPixels(gp2, p2);
    path.moveTo(p2.x, p2.y);
    path.lineTo(p1.x,p1.y);
    canvas.drawPath(path, somePaintObject);
}
origin: stackoverflow.com

 Point screenPts = new Point();

@Override
protected void drawOverlayBitmap(Canvas canvas, Point point, 
         Projection projection, byte zoom){

    projection.toPixels(new GeoPoint((int)(location.getLatitude()*1E6),
         (int)(location.getLongitude()*1E6)) , screenPts);
    canvas.drawBitmap(myBitmap, screenPts.x, screenPts.y, new Paint());
}
origin: stackoverflow.com

 Projection projection = mapView.getProjection();
Point center = projection.toPixels(new GeoPoint(yourLat * E6, yourLong * E6), null);
float radius = projection.metersToEquatorPixels(radiusInMeters);
canvas.draw(center.x, center.y, radius, new Paint());
origin: stackoverflow.com

 Projection projection = map.getProjection();
projection.toPixels(geoPointBefore, pt);
geoPointAfter = projection.fromPixels(pt.x, pt.y);

int diffLatitude  = geoPointBefore.getLatitudeE6()  - geoPointAfter.getLatitudeE6();
int diffLongitude = geoPointBefore.getLongitudeE6() - geoPointAfter.getLongitudeE6();
...
...
...
// Add the difference to GeoPoint objects after conversion `fromPixels`
origin: stackoverflow.com

 public class CrossHairsOverlay extends Overlay {
  public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) {
    super.draw(canvas, mapView, shadow);
    GeoPoint centerGp = mapView.getMapCenter();
    Projection projection = mapView.getProjection();
    Point centerPoint = projection.toPixels(centerGp, null);
    Paint p = new Paint();
    Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.crosshairs_dial);
    canvas.drawBitmap(bmp, centerPoint.x, centerPoint.y, p);
    return true;
  }
}
origin: stackoverflow.com

 public static void panMap (int x, int y, MapView map) {
  Point ptPixels = new Point();
  GeoPoint geoPt = map.getMapCenter();
  Projection projection = map.getProjection();
  projection.toPixels(geoPt, ptPixels);
  ptPixels.x += x;
  ptPixels.y += y;
  geoPt = projection.fromPixels(ptPixels.x, ptPixels.y);
  map.getController().animateTo(geoPt);
}
com.google.android.gms.mapsProjectiontoPixels

Popular methods of Projection

  • fromScreenLocation
  • toScreenLocation
  • getVisibleRegion
  • fromPixels
  • metersToEquatorPixels

Popular in Java

  • Creating JSON documents from java classes using gson
  • runOnUiThread (Activity)
  • onRequestPermissionsResult (Fragment)
  • compareTo (BigDecimal)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Path (java.nio.file)
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now