[android] #3309 - replace coordinate naming with LatLng
This commit is contained in:
@@ -53,7 +53,7 @@ public class BulkMarkerActivity extends AppCompatActivity implements AdapterView
|
||||
mMapView = (MapView) findViewById(R.id.mapView);
|
||||
mMapView.setAccessToken(ApiAccess.getToken(this));
|
||||
mMapView.onCreate(savedInstanceState);
|
||||
mMapView.setCenterCoordinate(new LatLngZoom(38.87031, -77.00897, 10));
|
||||
mMapView.setLatLng(new LatLngZoom(38.87031, -77.00897, 10));
|
||||
mMapView.setCompassEnabled(false);
|
||||
|
||||
ArrayAdapter<CharSequence> spinnerAdapter = ArrayAdapter.createFromResource(actionBar.getThemedContext(), R.array.bulk_marker_list, android.R.layout.simple_spinner_item);
|
||||
|
||||
@@ -38,7 +38,7 @@ public class CoordinateChangeActivity extends AppCompatActivity {
|
||||
mMapView.setAccessToken(ApiAccess.getToken(this));
|
||||
mMapView.onCreate(savedInstanceState);
|
||||
mMapView.setStyle(Style.MAPBOX_STREETS);
|
||||
mMapView.setCenterCoordinate(new LatLngZoom(38.87031, -77.00897, 16));
|
||||
mMapView.setLatLng(new LatLngZoom(38.87031, -77.00897, 16));
|
||||
mMapView.setCompassEnabled(false);
|
||||
|
||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||
@@ -46,12 +46,12 @@ public class CoordinateChangeActivity extends AppCompatActivity {
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
mMapView.setCenterCoordinate(getCoordinate(), true);
|
||||
mMapView.setLatLng(getNextLatLng(), true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private LatLng getCoordinate() {
|
||||
private LatLng getNextLatLng() {
|
||||
boolean first = (boolean) mMapView.getTag();
|
||||
mMapView.setTag(!first);
|
||||
return first ? new LatLng(38.87000, -77.00800) : new LatLng(38.87031, -77.00897);
|
||||
|
||||
@@ -479,7 +479,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
public void onMyLocationChange(@Nullable Location location) {
|
||||
if (location != null) {
|
||||
mMapView.setZoom(16);
|
||||
mMapView.setCenterCoordinate(new LatLng(location));
|
||||
mMapView.setLatLng(new LatLng(location));
|
||||
mMapView.setOnMyLocationChangeListener(null);
|
||||
}
|
||||
}
|
||||
@@ -508,7 +508,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
addPolyline();
|
||||
addPolygon();
|
||||
mMapView.setZoom(7);
|
||||
mMapView.setCenterCoordinate(new LatLng(38.11727, -122.22839));
|
||||
mMapView.setLatLng(new LatLng(38.11727, -122.22839));
|
||||
}
|
||||
} else {
|
||||
if (mIsAnnotationsOn) {
|
||||
|
||||
@@ -51,7 +51,7 @@ public class MapFragmentActivity extends AppCompatActivity {
|
||||
MapView mapView = getMap();
|
||||
mapView.setStyleUrl(Style.EMERALD);
|
||||
mapView.setZoom(12);
|
||||
mapView.setCenterCoordinate(new LatLng(50.853658, 4.352419));
|
||||
mapView.setLatLng(new LatLng(50.853658, 4.352419));
|
||||
|
||||
// move attribution control to right of screen
|
||||
mapView.setAttributionGravity(Gravity.BOTTOM | Gravity.END);
|
||||
|
||||
@@ -94,7 +94,7 @@ public class MyLocationTrackingModeActivity extends AppCompatActivity implements
|
||||
if (location != null) {
|
||||
if (mLocation == null) {
|
||||
// initial location to reposition map
|
||||
mMapView.setCenterCoordinate(new LatLng(location.getLatitude(), location.getLongitude()));
|
||||
mMapView.setLatLng(new LatLng(location.getLatitude(), location.getLongitude()));
|
||||
mLocationSpinner.setEnabled(true);
|
||||
mBearingSpinner.setEnabled(true);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class PressForMarkerActivity extends AppCompatActivity implements MapView
|
||||
mMapView = new MapView(this, ApiAccess.getToken(this));
|
||||
mMapView.setStyleUrl(Style.EMERALD);
|
||||
mMapView.onCreate(savedInstanceState);
|
||||
mMapView.setCenterCoordinate(new LatLng(45.1855569, 5.7215506));
|
||||
mMapView.setLatLng(new LatLng(45.1855569, 5.7215506));
|
||||
mMapView.setZoom(11);
|
||||
mMapView.setOnMapLongClickListener(this);
|
||||
((ViewGroup) findViewById(R.id.activity_container)).addView(mMapView);
|
||||
|
||||
@@ -34,7 +34,7 @@ public class TiltActivity extends AppCompatActivity {
|
||||
mMapView = (MapView) findViewById(R.id.tiltMapView);
|
||||
mMapView.setAccessToken(ApiAccess.getToken(this));
|
||||
mMapView.setStyleUrl(Style.MAPBOX_STREETS);
|
||||
mMapView.setCenterCoordinate(dc);
|
||||
mMapView.setLatLng(dc);
|
||||
mMapView.setZoom(11);
|
||||
mMapView.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user