本文整理汇总了Java中com.google.android.gms.maps.model.BitmapDescriptorFactory.fromResource方法的典型用法代码示例。如果您正苦于以下问题:Java BitmapDescriptorFactory.fromResource方法的具体用法?Java BitmapDescriptorFactory.fromResource怎么用?Java BitmapDescriptorFactory.fromResource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.gms.maps.model.BitmapDescriptorFactory
的用法示例。
在下文中一共展示了BitmapDescriptorFactory.fromResource方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMarker
import com.google.android.gms.maps.model.BitmapDescriptorFactory; //导入方法依赖的package包/类
public MarkerOptions getMarker() {
BitmapDescriptor markerIcon = BitmapDescriptorFactory.fromResource(R.drawable.ic_location_red);
BitmapDescriptor markerIconMobile = BitmapDescriptorFactory.fromResource(R.drawable.ic_location_mobile_red);
this.marker.position(this.getCoordinates());
this.marker.title(this.name);
this.marker.snippet(this.getAddress() + this.getDates());
if(this.isMobile == null) {
this.marker.icon(markerIcon);
} else {
if(this.isMobile == true) {
this.marker.icon(markerIconMobile);
} else {
this.marker.icon(markerIcon);
}
}
return this.marker;
}
示例2: updateMapView
import com.google.android.gms.maps.model.BitmapDescriptorFactory; //导入方法依赖的package包/类
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);
}
}
示例3: onCreate
import com.google.android.gms.maps.model.BitmapDescriptorFactory; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// ANALYTICS SCREEN: View the Map screen
// Contains: Nothing (Page name is a constant)
AnalyticsHelper.sendScreenView(SCREEN_LABEL);
// get DPI
mDPI = getActivity().getResources().getDisplayMetrics().densityDpi / 160f;
ICON_ACTIVE = BitmapDescriptorFactory.fromResource(R.drawable.map_marker_selected);
ICON_NORMAL =
BitmapDescriptorFactory.fromResource(R.drawable.map_marker_unselected);
// Get the arguments and restore the highlighted room or displayed floor.
Bundle data = getArguments();
if (data != null) {
mHighlightedRoomId = data.getString(EXTRAS_HIGHLIGHT_ROOM, null);
mInitialFloor = data.getInt(EXTRAS_ACTIVE_FLOOR, MOSCONE_DEFAULT_LEVEL_INDEX);
}
getMapAsync(this);
}
示例4: onMyLocationChange
import com.google.android.gms.maps.model.BitmapDescriptorFactory; //导入方法依赖的package包/类
@Override
public void onMyLocationChange(Location location)
{
if (myLocationMarker != null)
myLocationMarker.remove();
if (markerIconBitmapDescriptor == null)
markerIconBitmapDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.bg_trans_light);
myLocationMarker = gMap.addMarker(new MarkerOptions()
.position(new LatLng(location.getLatitude(), location.getLongitude()))
.icon(markerIconBitmapDescriptor));
}
示例5: updateMapView
import com.google.android.gms.maps.model.BitmapDescriptorFactory; //导入方法依赖的package包/类
private void updateMapView() {
if (mMap != null && mReminder != 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(mReminder.getPlace().getLatitude(), mReminder.getPlace().getLongitude());
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(loc, 13f));
mMap.addMarker(new MarkerOptions().position(loc).icon(icon));
}
}
示例6: createPinMarker
import com.google.android.gms.maps.model.BitmapDescriptorFactory; //导入方法依赖的package包/类
/**
* Creates a marker for a session.
*
* @param id Id to be embedded as the title
*/
public static MarkerOptions createPinMarker(String id, LatLng position) {
final BitmapDescriptor icon =
BitmapDescriptorFactory.fromResource(R.drawable.map_marker_unselected);
return new MarkerOptions().position(position).title(id).icon(icon).anchor(0.5f, 0.85526f)
.visible(
false);
}
示例7: createMosconeMarker
import com.google.android.gms.maps.model.BitmapDescriptorFactory; //导入方法依赖的package包/类
/**
* Creates a marker for Moscone Center.
*/
public static MarkerOptions createMosconeMarker(LatLng position) {
final String title = "MOSCONE";
final BitmapDescriptor icon =
BitmapDescriptorFactory.fromResource(R.drawable.map_marker_moscone);
return new MarkerOptions().position(position).title(title).icon(icon)
.visible(false);
}
示例8: addBump
import com.google.android.gms.maps.model.BitmapDescriptorFactory; //导入方法依赖的package包/类
private void addBump(Context context, GoogleMap map, BumpModel item, boolean addCache) {
LatLng location = new LatLng(item.getLatitude(), item.getLongitude());
if (bumpIcon == null) {
bumpIcon = BitmapDescriptorFactory.fromResource(R.drawable.ic_map_bump_red);
}
Marker marker = map.addMarker(new MarkerOptions()
.position(location)
.icon(bumpIcon)
.anchor(0.5f, 0.5f)
.title(item.getName())
.snippet(item.getDescription()));
if (addCache && markersCache != null) {
markersCache.put(marker, item);
}
}
示例9: bitmapForDbm
import com.google.android.gms.maps.model.BitmapDescriptorFactory; //导入方法依赖的package包/类
public static BitmapDescriptor bitmapForDbm(Integer dbm, Integer snr) {
if (dbm == null) {
if (snr == null) {
return BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_black_black);
}
if (snr < SNR_BORNE_RED) {
return BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_black_red);
}
if (snr < SNR_BORNE_ORANGE) {
return BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_black_orange);
}
if (snr < SNR_BORNE_YELLOW) {
return BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_black_yellow);
}
return BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_black_green);
}
if (dbm < TM_BORNE_RED) {
if (snr == null) {
return BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_red_black);
}
if (snr < SNR_BORNE_RED) {
return BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_red_red);
}
if (snr < SNR_BORNE_ORANGE) {
return BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_red_orange);
}
if (snr < SNR_BORNE_YELLOW) {
return BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_red_yellow);
}
return BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_red_green);
}
if (dbm < TM_BORNE_ORANGE) {
if (snr == null) {
return BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_orange_black);
}
if (snr < SNR_BORNE_RED) {
return BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_orange_red);
}
if (snr < SNR_BORNE_ORANGE) {
return BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_orange_orange);
}
if (snr < SNR_BORNE_YELLOW) {
return BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_orange_yellow);
}
return BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_orange_green);
}
if (dbm < TM_BORNE_YELLOW) {
if (snr == null) {
return BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_yellow_black);
}
if (snr < SNR_BORNE_RED) {
return BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_yellow_red);
}
if (snr < SNR_BORNE_ORANGE) {
return BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_yellow_orange);
}
if (snr < SNR_BORNE_YELLOW) {
return BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_yellow_yellow);
}
return BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_yellow_green);
}
if (snr == null) {
return BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_green_black);
}
if (snr < SNR_BORNE_RED) {
return BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_green_red);
}
if (snr < SNR_BORNE_ORANGE) {
return BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_green_orange);
}
if (snr < SNR_BORNE_YELLOW) {
return BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_green_yellow);
}
return BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_green_green);
}
示例10: createClusterItemIcon
import com.google.android.gms.maps.model.BitmapDescriptorFactory; //导入方法依赖的package包/类
@NonNull
private BitmapDescriptor createClusterItemIcon() {
return BitmapDescriptorFactory.fromResource(mIconStyle.getClusterIconResId());
}
示例11: getTagIcon
import com.google.android.gms.maps.model.BitmapDescriptorFactory; //导入方法依赖的package包/类
public BitmapDescriptor getTagIcon(TagModel.RoadCondition condition) {
BitmapDescriptor tagIcon = null;
int resourceId = getTagIconResId(condition);
tagIcon = BitmapDescriptorFactory.fromResource(resourceId);
return tagIcon;
}