Search in sources :

Example 1 with MarkerOptions

use of com.google.android.gms.maps.model.MarkerOptions in project cw-omnibus by commonsguy.

the class MainActivity method addMarker.

private void addMarker(GoogleMap map, double lat, double lon, int title, int snippet) {
    Marker marker = map.addMarker(new MarkerOptions().position(new LatLng(lat, lon)).title(getString(title)).snippet(getString(snippet)));
    builder.include(marker.getPosition());
}
Also used : MarkerOptions(com.google.android.gms.maps.model.MarkerOptions) Marker(com.google.android.gms.maps.model.Marker) LatLng(com.google.android.gms.maps.model.LatLng)

Example 2 with MarkerOptions

use of com.google.android.gms.maps.model.MarkerOptions in project actor-platform by actorapp.

the class MapPickerActivity method onMapLongClick.

@Override
public void onMapLongClick(LatLng latLng) {
    select.setEnabled(true);
    findViewById(R.id.select_text).setEnabled(true);
    // geoData = latLng;
    if (currentPick == null) {
        MarkerOptions currentPickOptions = new MarkerOptions().draggable(true).position(geoData);
    //currentPick = mMap.addMarker(currentPickOptions);
    } else {
    //currentPick.setPosition(geoData);
    }
}
Also used : MarkerOptions(com.google.android.gms.maps.model.MarkerOptions)

Example 3 with MarkerOptions

use of com.google.android.gms.maps.model.MarkerOptions in project Pokemap by omkarmoghe.

the class MapWrapperFragment method drawMarker.

private void drawMarker(LatLng position) {
    if (mGoogleMap != null) {
        Marker userSelectedPositionMarker = mGoogleMap.addMarker(new MarkerOptions().position(position).title(getString(R.string.position_picked)).icon(BitmapDescriptorFactory.fromBitmap(BitmapFactory.decodeResource(getContext().getResources(), R.drawable.ic_my_location_white_24dp))).zIndex(MapHelper.LAYER_MY_SEARCH).anchor(0.5f, 0.5f));
        userSelectedPositionMarkers.add(userSelectedPositionMarker);
    } else {
        showMapNotInitializedError();
    }
}
Also used : MarkerOptions(com.google.android.gms.maps.model.MarkerOptions) Marker(com.google.android.gms.maps.model.Marker)

Example 4 with MarkerOptions

use of com.google.android.gms.maps.model.MarkerOptions in project DraggablePanel by pedrovgs.

the class PlacesSampleActivity method showPlace.

/**
   * Show a place in PlaceFragment and SupportMapFragment and apply the maximize effect over the
   * DraggablePanel.
   */
private void showPlace(int position) {
    draggablePanel.setVisibility(View.VISIBLE);
    draggablePanel.maximize();
    PlaceViewModel placeViewModel = placesAdapter.getItem(position);
    placeFragment.showPlace(placeViewModel);
    mapFragment.getMap().clear();
    LatLng latitudeLongitude = new LatLng(placeViewModel.getLatitude(), placeViewModel.getLongitude());
    MarkerOptions marker = new MarkerOptions().position(latitudeLongitude);
    marker.title(placeViewModel.getName());
    marker.snippet(placeViewModel.getLatitude() + " , " + placeViewModel.getLongitude());
    mapFragment.getMap().addMarker(marker);
    mapFragment.getMap().moveCamera(CameraUpdateFactory.newLatLngZoom(latitudeLongitude, ZOOM));
}
Also used : PlaceViewModel(com.github.pedrovgs.sample.viewmodel.PlaceViewModel) MarkerOptions(com.google.android.gms.maps.model.MarkerOptions) LatLng(com.google.android.gms.maps.model.LatLng)

Example 5 with MarkerOptions

use of com.google.android.gms.maps.model.MarkerOptions in project google-io-2014 by romainguy.

the class DetailActivity method setupMap.

private void setupMap() {
    GoogleMap map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
    double lat = getIntent().getDoubleExtra("lat", 37.6329946);
    double lng = getIntent().getDoubleExtra("lng", -122.4938344);
    float zoom = getIntent().getFloatExtra("zoom", 15.0f);
    LatLng position = new LatLng(lat, lng);
    map.moveCamera(CameraUpdateFactory.newLatLngZoom(position, zoom));
    map.addMarker(new MarkerOptions().position(position));
}
Also used : MarkerOptions(com.google.android.gms.maps.model.MarkerOptions) GoogleMap(com.google.android.gms.maps.GoogleMap) MapFragment(com.google.android.gms.maps.MapFragment) 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