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;
}
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;
}
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);
}
}
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);
}
}
}
Aggregations