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

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

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

origin: airbnb/AirMapView

@Override public void getMapScreenBounds(OnMapBoundsCallback callback) {
 final Projection projection = googleMap.getProjection();
 int hOffset = getResources().getDimensionPixelOffset(R.dimen.map_horizontal_padding);
 int vOffset = getResources().getDimensionPixelOffset(R.dimen.map_vertical_padding);
 LatLngBounds.Builder builder = LatLngBounds.builder();
 builder.include(projection.fromScreenLocation(new Point(hOffset, vOffset))); // top-left
 builder.include(projection.fromScreenLocation(
   new Point(getView().getWidth() - hOffset, vOffset))); // top-right
 builder.include(projection.fromScreenLocation(
   new Point(hOffset, getView().getHeight() - vOffset))); // bottom-left
 builder.include(projection.fromScreenLocation(new Point(getView().getWidth() - hOffset,
   getView().getHeight() - vOffset))); // bottom-right
 callback.onMapBoundsReady(builder.build());
}
origin: googlemaps/android-samples

@Override
public void onMapLongClick(LatLng point) {
  // We know the center, let's place the outline at a point 3/4 along the view.
  View view = getSupportFragmentManager().findFragmentById(R.id.map).getView();
  LatLng radiusLatLng = mMap.getProjection().fromScreenLocation(new Point(
      view.getHeight() * 3 / 4, view.getWidth() * 3 / 4));
  // Create the circle.
  DraggableCircle circle = new DraggableCircle(point, toRadiusMeters(point, radiusLatLng));
  mCircles.add(circle);
}
origin: mg6maciej/android-maps-extensions

@Override
public LatLng fromScreenLocation(Point point) {
  return projection.fromScreenLocation(point);
}
origin: mg6maciej/android-maps-extensions

private double calculateDistanceBetweenMarkers() {
  Projection projection = map.getProjection();
  Point point = projection.toScreenLocation(new LatLng(0.0, 0.0));
  point.x += getResources().getDimensionPixelSize(R.dimen.distance_between_markers);
  LatLng nextPosition = projection.fromScreenLocation(point);
  return nextPosition.longitude;
}
origin: Bhoomika06/Styled-Map-Pager

@Override
public void onPageSelected(int position) {
  MyLocation location = latLngsArrayList.get(position);
  Point mappoint = map.getProjection().toScreenLocation(
      new LatLng(location.getLatitude(), location.getLongitude()));
  mappoint.set(mappoint.x, mappoint.y - 30);
  map.animateCamera(CameraUpdateFactory.newLatLng(map.getProjection().fromScreenLocation(mappoint)));
  customMap.addSelectedCustomPin(position);
}
origin: sarweshkumar47/Curve-Fit

    PixelControlPoints.getFirstPixelControlPoint(),
    PixelControlPoints.getSecondPixelControlPoint(), endPoint, step);
LatLng curveLatLng = mapProjection.fromScreenLocation(curveXYPoint);
curveOptions.getReal().add(curveLatLng);
origin: CUTR-at-USF/OpenTripPlanner-for-Android

LatLng newLimitSouthWestLatLng = mMap.getProjection().fromScreenLocation(newLimitSouthWest);
LatLng newLimitNorthEastLatLng = mMap.getProjection().fromScreenLocation(newLimitNorthEast);
origin: ac-opensource/MarkerBuilder

  LatLng radiusLatLng = googleMap.getProjection().fromScreenLocation(new Point(screenCenterPoint.x + (int)radius, screenCenterPoint.y));
  initRadiusMetersFinal = MarkerAreasUtils.toRadiusMeters(point, radiusLatLng);
} else {
com.google.android.gms.mapsProjectionfromScreenLocation

Popular methods of Projection

  • toScreenLocation
  • getVisibleRegion
  • fromPixels
  • metersToEquatorPixels
  • toPixels

Popular in Java

  • Making http post requests using okhttp
  • requestLocationUpdates (LocationManager)
  • getContentResolver (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • JLabel (javax.swing)
  • Github Copilot alternatives
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