use of com.google.android.gms.maps.model.MarkerOptions in project Remindy by abicelis.
the class PlaceViewHolder method updateMapView.
private void updateMapView() {
if (mCurrent != null) {
mMap.clear();
// Add a marker for this item and set the camera
BitmapDescriptor icon = BitmapDescriptorFactory.fromResource(R.drawable.icon_marker);
LatLng loc = new LatLng(mCurrent.getLatitude(), mCurrent.getLongitude());
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(loc, 13f));
mMap.addMarker(new MarkerOptions().position(loc).icon(icon));
// // Set the map type back to normal.
// mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
}
}
use of com.google.android.gms.maps.model.MarkerOptions in project Remindy by abicelis.
the class LocationBasedReminderDetailFragment method setUpMap.
@SuppressWarnings({ "MissingPermission" })
private void setUpMap() {
mMap.setMyLocationEnabled(true);
//mMap.setPadding(0, ConversionUtil.dpToPx(68, getResources()), 0, 0);
mMap.getUiSettings().setMyLocationButtonEnabled(true);
//Add circle and marker
int strokeColor = ContextCompat.getColor(getActivity(), R.color.map_circle_stroke);
int shadeColor = ContextCompat.getColor(getActivity(), R.color.map_circle_shade);
LatLng latLng = ConversionUtil.placeToLatLng(mReminder.getPlace());
mMap.addCircle(new CircleOptions().center(latLng).radius(mReminder.getPlace().getRadius()).fillColor(shadeColor).strokeColor(strokeColor).strokeWidth(2));
mMap.addMarker(new MarkerOptions().position(latLng));
//Move camera
//mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latlng, 15), 1000, null); //Zoom level 15 = Streets, 1000ms animation
CameraPosition cameraPos = new CameraPosition.Builder().tilt(60).target(latLng).zoom(15).build();
mMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPos), 1000, null);
}
use of com.google.android.gms.maps.model.MarkerOptions in project NPSmiles by bmcglynn1.
the class ItemOneFragment method onMapReady.
@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
LatLng smiles = new LatLng(39.104729, -77.191294);
mMap.addMarker(new MarkerOptions().position(smiles).title("North Potomac Smiles, LLC."));
mMap.moveCamera(CameraUpdateFactory.newLatLng(smiles));
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(smiles, 16));
}
Aggregations