当前位置: 首页>>代码示例>>Java>>正文


Java BitmapDescriptorFactory.fromResource方法代码示例

本文整理汇总了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;
}
 
开发者ID:team-htbr,项目名称:1617PROJ1Bloeddonatie-app,代码行数:22,代码来源:Location.java

示例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);
        }
    }
 
开发者ID:abicelis,项目名称:Remindy,代码行数:17,代码来源:PlaceViewHolder.java

示例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);
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:25,代码来源:MapFragment.java

示例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)); 
}
 
开发者ID:rtr-nettest,项目名称:open-rmbt,代码行数:14,代码来源:RMBTMapFragment.java

示例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));
        }
    }
 
开发者ID:abicelis,项目名称:Remindy,代码行数:15,代码来源:EditLocationBasedReminderFragment.java

示例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);
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:13,代码来源:MapUtils.java

示例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);
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:13,代码来源:MapUtils.java

示例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);
    }
}
 
开发者ID:WorldBank-Transport,项目名称:RoadLab-Pro,代码行数:16,代码来源:MeasurementsGoogleMapHelper.java

示例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);
}
 
开发者ID:ANFR-France,项目名称:proto-collecte,代码行数:76,代码来源:Colors.java

示例10: createClusterItemIcon

import com.google.android.gms.maps.model.BitmapDescriptorFactory; //导入方法依赖的package包/类
@NonNull
private BitmapDescriptor createClusterItemIcon() {
    return BitmapDescriptorFactory.fromResource(mIconStyle.getClusterIconResId());
}
 
开发者ID:sharewire,项目名称:google-maps-clustering,代码行数:5,代码来源:DefaultIconGenerator.java

示例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;
}
 
开发者ID:WorldBank-Transport,项目名称:RoadLab-Pro,代码行数:7,代码来源:MeasurementsGoogleMapHelper.java


注:本文中的com.google.android.gms.maps.model.BitmapDescriptorFactory.fromResource方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。