本文整理汇总了Java中com.baidu.mapapi.map.Overlay类的典型用法代码示例。如果您正苦于以下问题:Java Overlay类的具体用法?Java Overlay怎么用?Java Overlay使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Overlay类属于com.baidu.mapapi.map包,在下文中一共展示了Overlay类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: zoomToSpan
import com.baidu.mapapi.map.Overlay; //导入依赖的package包/类
/**
* 缩放地图,使所有Overlay都在合适的视野内
* <p>
* 注: 该方法只对Marker类型的overlay有效
* </p>
*
*/
public void zoomToSpan() {
if (mBaiduMap == null) {
return;
}
if (mOverlayList.size() > 0) {
LatLngBounds.Builder builder = new LatLngBounds.Builder();
for (Overlay overlay : mOverlayList) {
// polyline 中的点可能太多,只按marker 缩放
if (overlay instanceof Marker) {
builder.include(((Marker) overlay).getPosition());
}
}
mBaiduMap.setMapStatus(MapStatusUpdateFactory
.newLatLngBounds(builder.build()));
}
}
示例2: zoomToSpan
import com.baidu.mapapi.map.Overlay; //导入依赖的package包/类
/**
* 缩放地图,使所有Overlay都在合适的视野内
* <p>
* 注: 该方法只对Marker类型的overlay有效
* </p>
*/
public void zoomToSpan() {
if (mBaiduMap == null) {
return;
}
if (mOverlayList.size() > 0) {
LatLngBounds.Builder builder = new LatLngBounds.Builder();
for (Overlay overlay : mOverlayList) {
// polyline 中的点可能太多,只按marker 缩放
if (overlay instanceof Marker) {
builder.include(((Marker) overlay).getPosition());
}
}
mBaiduMap.setMapStatus(MapStatusUpdateFactory
.newLatLngBounds(builder.build()));
}
}
示例3: zoomToSpan
import com.baidu.mapapi.map.Overlay; //导入依赖的package包/类
/**
* ���ŵ�ͼ��ʹ����Overlay���ں��ʵ���Ұ��
* <p>
* ע�� �÷���ֻ��Marker���͵�overlay��Ч
* </p>
*
*/
public void zoomToSpan() {
if (mBaiduMap == null) {
return;
}
if (mOverlayList.size() > 0) {
LatLngBounds.Builder builder = new LatLngBounds.Builder();
for (Overlay overlay : mOverlayList) {
// polyline �еĵ����̫�ֻ࣬��marker ����
if (overlay instanceof Marker) {
builder.include(((Marker) overlay).getPosition());
}
}
mBaiduMap.setMapStatus(MapStatusUpdateFactory
.newLatLngBounds(builder.build()));
}
}
示例4: zoomToSpan
import com.baidu.mapapi.map.Overlay; //导入依赖的package包/类
/**
* 缩放地图,使所有Overlay都在合适的视野内
* <p>
* 注: 该方法只对Marker类型的overlay有效
* </p>
*
*/
public void zoomToSpan() {
if (mBaiduMap == null) {
return;
}
if (mOverlayList.size() > 0) {
LatLngBounds.Builder builder = new LatLngBounds.Builder();
for (Overlay overlay : mOverlayList) {
// polyline 中的点可能太多,只按marker 缩放
if (overlay instanceof Marker) {
builder.include(((Marker) overlay).getPosition());
}
}
mBaiduMap.setMapStatus(MapStatusUpdateFactory
.newLatLngBounds(builder.build()));
}
}
示例5: onMarkerClick
import com.baidu.mapapi.map.Overlay; //导入依赖的package包/类
@Override
public final boolean onMarkerClick(Marker marker) {
for (Overlay mMarker : mOverlayList) {
if (mMarker instanceof Marker && mMarker.equals(marker)) {
if (marker.getExtraInfo() != null) {
onRouteNodeClick(marker.getExtraInfo().getInt("index"));
}
}
}
return true;
}
示例6: OverlayManager
import com.baidu.mapapi.map.Overlay; //导入依赖的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>();
}
}
示例7: removeFromMap
import com.baidu.mapapi.map.Overlay; //导入依赖的package包/类
/**
* 将所有Overlay 从 地图上消除
*/
public final void removeFromMap() {
if (mBaiduMap == null) {
return;
}
for (Overlay marker : mOverlayList) {
marker.remove();
}
mOverlayOptionList.clear();
mOverlayList.clear();
}
示例8: onPolylineClick
import com.baidu.mapapi.map.Overlay; //导入依赖的package包/类
@Override
public boolean onPolylineClick(Polyline polyline) {
boolean flag = false;
for (Overlay mPolyline : mOverlayList) {
if (mPolyline instanceof Polyline && mPolyline.equals(polyline)) {
// 选中
flag = true;
break;
}
}
setFocus(flag);
return true;
}
示例9: setFocus
import com.baidu.mapapi.map.Overlay; //导入依赖的package包/类
public void setFocus(boolean flag) {
focus = flag;
for (Overlay mPolyline : mOverlayList) {
if (mPolyline instanceof Polyline) {
// 选中
((Polyline) mPolyline).setFocus(flag);
break;
}
}
}
示例10: OverlayManager
import com.baidu.mapapi.map.Overlay; //导入依赖的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>();
}
}