Search in sources :

Example 36 with MarkerOptions

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);
    }
}
Also used : MarkerOptions(com.google.android.gms.maps.model.MarkerOptions) BitmapDescriptor(com.google.android.gms.maps.model.BitmapDescriptor) LatLng(com.google.android.gms.maps.model.LatLng)

Example 37 with MarkerOptions

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);
}
Also used : CameraPosition(com.google.android.gms.maps.model.CameraPosition) MarkerOptions(com.google.android.gms.maps.model.MarkerOptions) CircleOptions(com.google.android.gms.maps.model.CircleOptions) LatLng(com.google.android.gms.maps.model.LatLng)

Example 38 with MarkerOptions

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));
}
Also used : MarkerOptions(com.google.android.gms.maps.model.MarkerOptions) LatLng(com.google.android.gms.maps.model.LatLng)

Aggregations

MarkerOptions (com.google.android.gms.maps.model.MarkerOptions)38 LatLng (com.google.android.gms.maps.model.LatLng)23 BitmapDescriptor (com.google.android.gms.maps.model.BitmapDescriptor)7 Marker (com.google.android.gms.maps.model.Marker)6 GoogleMap (com.google.android.gms.maps.GoogleMap)5 Bitmap (android.graphics.Bitmap)4 View (android.view.View)4 Document (org.w3c.dom.Document)4 OnClickListener (android.view.View.OnClickListener)3 GoogleDirection (app.akexorcist.gdaplibrary.GoogleDirection)3 OnDirectionResponseListener (app.akexorcist.gdaplibrary.GoogleDirection.OnDirectionResponseListener)3 OnMapReadyCallback (com.google.android.gms.maps.OnMapReadyCallback)3 PolylineOptions (com.google.android.gms.maps.model.PolylineOptions)3 RemoteImageLoader (com.omkarmoghe.pokemap.helpers.RemoteImageLoader)3 TextView (android.widget.TextView)2 OnAnimateListener (app.akexorcist.gdaplibrary.GoogleDirection.OnAnimateListener)2 CameraPosition (com.google.android.gms.maps.model.CameraPosition)2 CircleOptions (com.google.android.gms.maps.model.CircleOptions)2 PokemonIdOuterClass (POGOProtos.Enums.PokemonIdOuterClass)1 FortDataOuterClass (POGOProtos.Map.Fort.FortDataOuterClass)1