Search in sources :

Example 26 with BitmapDescriptor

use of com.google.android.gms.maps.model.BitmapDescriptor in project iosched by google.

the class MapUtils method createPinMarker.

/**
 * Creates a GeoJsonPointStyle for a session.
 *
 * @param title Id to be embedded as the title
 */
public static GeoJsonPointStyle createPinMarker(@NonNull Context context, String title) {
    final BitmapDescriptor icon = BitmapDescriptorFactory.fromBitmap(UIUtils.drawableToBitmap(context, R.drawable.map_marker_unselected));
    GeoJsonPointStyle pointStyle = new GeoJsonPointStyle();
    pointStyle.setTitle(title);
    pointStyle.setIcon(icon);
    pointStyle.setVisible(false);
    pointStyle.setAnchor(0.5f, 0.85526f);
    return pointStyle;
}
Also used : GeoJsonPointStyle(com.google.maps.android.geojson.GeoJsonPointStyle) BitmapDescriptor(com.google.android.gms.maps.model.BitmapDescriptor)

Example 27 with BitmapDescriptor

use of com.google.android.gms.maps.model.BitmapDescriptor in project iosched by google.

the class MapUtils method createIconMarker.

/**
 * Creates a GeoJsonPointStyle for an icon. The icon is selected
 * in {@link #getDrawableForIconType(Context, String)} and anchored
 * at the bottom center for the location. When isActive is set to true, the icon is tinted.
 */
private static GeoJsonPointStyle createIconMarker(final String iconType, final String title, boolean isActive, Context context) {
    final Bitmap iconBitmap = getIconMarkerBitmap(context, iconType, isActive);
    final BitmapDescriptor icon = BitmapDescriptorFactory.fromBitmap(iconBitmap);
    GeoJsonPointStyle pointStyle = new GeoJsonPointStyle();
    pointStyle.setTitle(title);
    pointStyle.setVisible(false);
    pointStyle.setIcon(icon);
    pointStyle.setAnchor(0.5f, 1f);
    return pointStyle;
}
Also used : Bitmap(android.graphics.Bitmap) GeoJsonPointStyle(com.google.maps.android.geojson.GeoJsonPointStyle) BitmapDescriptor(com.google.android.gms.maps.model.BitmapDescriptor)

Example 28 with BitmapDescriptor

use of com.google.android.gms.maps.model.BitmapDescriptor 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 29 with BitmapDescriptor

use of com.google.android.gms.maps.model.BitmapDescriptor in project SEProject by NicholasBarreyre.

the class MapsActivity method populateMapMarkers.

private void populateMapMarkers() {
    for (Marker m : markerList) {
        m.remove();
    }
    for (UserLocation userLoc : friendLocationList) {
        if (!userLoc.getUsername().equals(user.getUsername()) && isRecent(userLoc.getTime())) {
            BitmapDescriptor icon = BitmapDescriptorFactory.fromResource(UserLocation.IMAGE_ID_MAP.get(userLoc.getImageId()));
            Marker marker = mMap.addMarker(new MarkerOptions().position(new LatLng(userLoc.getLat(), userLoc.getLon())).icon(icon).title(userLoc.getUsername()));
            markerList.add(marker);
        }
    }
}
Also used : MarkerOptions(com.google.android.gms.maps.model.MarkerOptions) BitmapDescriptor(com.google.android.gms.maps.model.BitmapDescriptor) Marker(com.google.android.gms.maps.model.Marker) LatLng(com.google.android.gms.maps.model.LatLng)

Aggregations

BitmapDescriptor (com.google.android.gms.maps.model.BitmapDescriptor)29 LatLng (com.google.android.gms.maps.model.LatLng)10 Bitmap (android.graphics.Bitmap)9 MarkerOptions (com.google.android.gms.maps.model.MarkerOptions)9 Marker (com.google.android.gms.maps.model.Marker)7 SuppressLint (android.annotation.SuppressLint)4 GroundOverlayOptions (com.google.android.gms.maps.model.GroundOverlayOptions)4 Point (com.google.maps.android.geometry.Point)4 RemoteImageLoader (com.omkarmoghe.pokemap.helpers.RemoteImageLoader)4 GeoJsonPointStyle (com.google.maps.android.geojson.GeoJsonPointStyle)3 FortDataOuterClass (POGOProtos.Map.Fort.FortDataOuterClass)2 GoogleMap (com.google.android.gms.maps.GoogleMap)2 GroundOverlay (com.google.android.gms.maps.model.GroundOverlay)2 IALatLng (com.indooratlas.android.sdk.resources.IALatLng)2 GymMarkerExtended (com.omkarmoghe.pokemap.models.map.GymMarkerExtended)2 PokemonMarkerExtended (com.omkarmoghe.pokemap.models.map.PokemonMarkerExtended)2 PokestopMarkerExtended (com.omkarmoghe.pokemap.models.map.PokestopMarkerExtended)2 Pokestop (com.pokegoapi.api.map.fort.Pokestop)2 CatchablePokemon (com.pokegoapi.api.map.pokemon.CatchablePokemon)2 PokemonIdOuterClass (POGOProtos.Enums.PokemonIdOuterClass)1