當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。