本文整理匯總了Java中com.baidu.mapapi.map.OverlayOptions類的典型用法代碼示例。如果您正苦於以下問題:Java OverlayOptions類的具體用法?Java OverlayOptions怎麽用?Java OverlayOptions使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
OverlayOptions類屬於com.baidu.mapapi.map包,在下文中一共展示了OverlayOptions類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getOverlayOptions
import com.baidu.mapapi.map.OverlayOptions; //導入依賴的package包/類
@Override
public final List<OverlayOptions> getOverlayOptions() {
if (mIndoorPoiResult == null || mIndoorPoiResult.getmArrayPoiInfo() == null) {
return null;
}
List<OverlayOptions> markerList = new ArrayList<OverlayOptions>();
int markerSize = 0;
for (int i = 0; i < mIndoorPoiResult.getmArrayPoiInfo().size()
&& markerSize < MAX_POI_SIZE; i++) {
if (mIndoorPoiResult.getmArrayPoiInfo().get(i).latLng == null) {
continue;
}
markerSize++;
Bundle bundle = new Bundle();
bundle.putInt("index", i);
markerList.add(new MarkerOptions()
.icon(BitmapDescriptorFactory.fromAssetWithDpi("Icon_mark"
+ markerSize + ".png")).extraInfo(bundle)
.position(mIndoorPoiResult.getmArrayPoiInfo().get(i).latLng));
}
return markerList;
}
示例2: getOverlayOptions
import com.baidu.mapapi.map.OverlayOptions; //導入依賴的package包/類
@Override
public final List<OverlayOptions> getOverlayOptions() {
if (mPoiResult == null || mPoiResult.getAllPoi() == null) {
return null;
}
List<OverlayOptions> markerList = new ArrayList<OverlayOptions>();
int markerSize = 0;
for (int i = 0; i < mPoiResult.getAllPoi().size()
&& markerSize < MAX_POI_SIZE; i++) {
if (mPoiResult.getAllPoi().get(i).location == null) {
continue;
}
markerSize++;
Bundle bundle = new Bundle();
bundle.putInt("index", i);
markerList.add(new MarkerOptions()
.icon(BitmapDescriptorFactory.fromAssetWithDpi("Icon_mark"
+ markerSize + ".png")).extraInfo(bundle)
.position(mPoiResult.getAllPoi().get(i).location));
}
return markerList;
}
示例3: addToMap
import com.baidu.mapapi.map.OverlayOptions; //導入依賴的package包/類
/**
* 將所有Overlay 添加到地圖上
*/
public final void addToMap() {
if (mBaiduMap == null) {
return;
}
removeFromMap();
List<OverlayOptions> overlayOptions = getOverlayOptions();
if (overlayOptions != null) {
mOverlayOptionList.addAll(getOverlayOptions());
}
for (OverlayOptions option : mOverlayOptionList) {
mOverlayList.add(mBaiduMap.addOverlay(option));
}
}
示例4: handleMessage
import com.baidu.mapapi.map.OverlayOptions; //導入依賴的package包/類
@Override
public void handleMessage(Message msg) {
final SeeLocationActivity activity = activityWeakReference.get();
switch (msg.what) {
case 0:
final String response = (String) msg.obj;
Scanner scanner = new Scanner(response);
double latitude = Double.parseDouble(scanner.next());
double longitude = Double.parseDouble(scanner.next());
LatLng point = new LatLng(latitude, longitude);
if (activity.centP == null) {
activity.centP = point;
activity.baiduMap.setMapStatus(MapStatusUpdateFactory.newLatLng(activity.centP));
}
activity.initHeadBitmap();
OverlayOptions options = new MarkerOptions().position(point).icon(activity.bitmapDescriptor);
activity.baiduMap.clear();
activity.baiduMap.addOverlay(options);
break;
}
}
示例5: addMarker
import com.baidu.mapapi.map.OverlayOptions; //導入依賴的package包/類
private void addMarker() {
if (stLatLng != null) {
BitmapDescriptor bitmap = BitmapDescriptorFactory.fromResource(R.drawable.ct_map_location_32);
OverlayOptions option = new MarkerOptions().position(stLatLng).icon(bitmap);
mBaiduMap.addOverlay(option);
}
if (msUpdate != null) {
mBaiduMap.setMapStatus(msUpdate);
}
if (polyline != null) {
mBaiduMap.addOverlay(polyline);
}
if (overlay != null) {
mBaiduMap.addOverlay(overlay);
}
}
示例6: addToMap
import com.baidu.mapapi.map.OverlayOptions; //導入依賴的package包/類
/**
* ������Overlay ��ӵ���ͼ��
*/
public final void addToMap() {
if (mBaiduMap == null) {
return;
}
removeFromMap();
List<OverlayOptions> overlayOptions = getOverlayOptions();
if (overlayOptions != null) {
mOverlayOptionList.addAll(getOverlayOptions());
}
for (OverlayOptions option : mOverlayOptionList) {
mOverlayList.add(mBaiduMap.addOverlay(option));
}
}
示例7: initMaker
import com.baidu.mapapi.map.OverlayOptions; //導入依賴的package包/類
private void initMaker() {
for (FootInfo info : mFootList) {
if (info.geo != null) {
Double lat = Double.valueOf(info.geo.latitude);
Double lon = Double.valueOf(info.geo.longitude);
// 定義Maker坐標點
LatLng point = new LatLng(lat,lon);
// 構建Marker圖標
BitmapDescriptor bitmap = BitmapDescriptorFactory
.fromResource(R.drawable.icon_gcoding);
// 構建MarkerOption,用於在地圖上添加Marker
OverlayOptions option = new MarkerOptions().position(point)
.icon(bitmap).zIndex(19);
marker = (Marker)baiduMap.addOverlay(option);
}
}
mMapView.invalidate();
}
示例8: setMarker
import com.baidu.mapapi.map.OverlayOptions; //導入依賴的package包/類
/**
* 顯示地理標記
*
* @param mapView
* @param array
*/
@ReactProp(name="marker")
public void setMarker(MapView mapView, ReadableArray array) {
Log.d(TAG, "marker:" + array);
if (array != null) {
for (int i = 0; i < array.size(); i++) {
ReadableArray sub = array.getArray(i);
//定義Maker坐標點
LatLng point = new LatLng(sub.getDouble(0), sub.getDouble(1));
//構建Marker圖標
BitmapDescriptor bitmap = BitmapDescriptorFactory.fromResource(R.drawable.icon_gcoding);
//構建MarkerOption,用於在地圖上添加Marker
OverlayOptions option = new MarkerOptions()
.position(point)
.icon(bitmap)
.draggable(true);
//在地圖上添加Marker,並顯示
mapView.getMap().addOverlay(option);
}
}
}
示例9: getOverlayOptions
import com.baidu.mapapi.map.OverlayOptions; //導入依賴的package包/類
@Override
public final List<OverlayOptions> getOverlayOptions() {
if (mBusLineResult == null || mBusLineResult.getStations() == null) {
return null;
}
List<OverlayOptions> overlayOptionses = new ArrayList<OverlayOptions>();
for (BusLineResult.BusStation station : mBusLineResult.getStations()) {
overlayOptionses.add(new MarkerOptions()
.position(station.getLocation())
.zIndex(10)
.anchor(0.5f, 0.5f)
.icon(BitmapDescriptorFactory
.fromAssetWithDpi("Icon_bus_station.png")));
}
List<LatLng> points = new ArrayList<LatLng>();
for (BusLineResult.BusStep step : mBusLineResult.getSteps()) {
if (step.getWayPoints() != null) {
points.addAll(step.getWayPoints());
}
}
if (points.size() > 0) {
overlayOptionses
.add(new PolylineOptions().width(10)
.color(Color.argb(178, 0, 78, 255)).zIndex(0)
.points(points));
}
return overlayOptionses;
}
示例10: OverlayManager
import com.baidu.mapapi.map.OverlayOptions; //導入依賴的package包/類
/**
* 通過一個BaiduMap 對象構造
*
* @param baiduMap
*/
public OverlayManager(BaiduMap baiduMap) {
mBaiduMap = baiduMap;
// mBaiduMap.setOnMarkerClickListener(this);
if (mOverlayOptionList == null) {
mOverlayOptionList = new ArrayList<OverlayOptions>();
}
if (mOverlayList == null) {
mOverlayList = new ArrayList<Overlay>();
}
}
示例11: showMap
import com.baidu.mapapi.map.OverlayOptions; //導入依賴的package包/類
private void showMap(double latitude, double longtitude, String address) {
sendButton.setVisibility(View.GONE);
LatLng llA = new LatLng(latitude, longtitude);
CoordinateConverter converter= new CoordinateConverter();
converter.coord(llA);
converter.from(CoordinateConverter.CoordType.COMMON);
LatLng convertLatLng = converter.convert();
OverlayOptions ooA = new MarkerOptions().position(convertLatLng).icon(BitmapDescriptorFactory
.fromResource(R.drawable.ease_icon_marka))
.zIndex(4).draggable(true);
mBaiduMap.addOverlay(ooA);
MapStatusUpdate u = MapStatusUpdateFactory.newLatLngZoom(convertLatLng, 17.0f);
mBaiduMap.animateMapStatus(u);
}
示例12: onReceiveLocation
import com.baidu.mapapi.map.OverlayOptions; //導入依賴的package包/類
@Override
public void onReceiveLocation(BDLocation location) {
if (location == null) {
return;
}
Log.d("map", "On location change received:" + location);
Log.d("map", "addr:" + location.getAddrStr());
sendButton.setEnabled(true);
if (progressDialog != null) {
progressDialog.dismiss();
}
if (lastLocation != null) {
if (lastLocation.getLatitude() == location.getLatitude() && lastLocation.getLongitude() == location.getLongitude()) {
Log.d("map", "same location, skip refresh");
// mMapView.refresh(); //need this refresh?
return;
}
}
lastLocation = location;
mBaiduMap.clear();
LatLng llA = new LatLng(lastLocation.getLatitude(), lastLocation.getLongitude());
CoordinateConverter converter= new CoordinateConverter();
converter.coord(llA);
converter.from(CoordinateConverter.CoordType.COMMON);
LatLng convertLatLng = converter.convert();
OverlayOptions ooA = new MarkerOptions().position(convertLatLng).icon(BitmapDescriptorFactory
.fromResource(R.drawable.ease_icon_marka))
.zIndex(4).draggable(true);
mBaiduMap.addOverlay(ooA);
MapStatusUpdate u = MapStatusUpdateFactory.newLatLngZoom(convertLatLng, 17.0f);
mBaiduMap.animateMapStatus(u);
}
示例13: initOverlay
import com.baidu.mapapi.map.OverlayOptions; //導入依賴的package包/類
/**
* initOverlay 設置覆蓋物,這裏就是地圖上那個點
*/
private void initOverlay() {
LatLng ll = new LatLng(AppApplication.mMockGps.mLatitude, AppApplication.mMockGps.mLongitude);
OverlayOptions oo = new MarkerOptions().position(ll).icon(bd).zIndex(9)
.draggable(true);
mMarker = (Marker) (mBaiduMap.addOverlay(oo));
}
示例14: addDestInfoOverlay
import com.baidu.mapapi.map.OverlayOptions; //導入依賴的package包/類
private void addDestInfoOverlay(LatLng latLng1) {
mBaiduMap.clear();
OverlayOptions options=new MarkerOptions().position(latLng1)
.icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_place))
.zIndex(5);
mBaiduMap.addOverlay(options);
}
示例15: addDestInfoOverlay
import com.baidu.mapapi.map.OverlayOptions; //導入依賴的package包/類
/**
* 添加目標點
*
* @param arg0
*/
private void addDestInfoOverlay(LatLng arg0) {
mbaiduMap.clear();
OverlayOptions options = new MarkerOptions().position(arg0)
.icon(BitmapDescriptorFactory.fromResource(R.drawable.maker))
.zIndex(5);
Marker marker = (Marker) mbaiduMap.addOverlay(options);
list.add(marker);
}