android百度地图overlay
⑴ 百度地图 如何改变overlay的坐标 android
改变overlay的坐标?
是要实现什么?
⑵ 百度地图最新api 还有popupoverlay么
网络地图 Android SDK是一套基于Android 2.1及以上版本设备的应用程序接口。 您可以使用该套 SDK开发适用于Android系统移动设备的地图应用,通过调用地图SDK接口,您可以轻松访问网络地图服务和数据,构建功能丰富、交互性强的地图类应用程序。
自v4.0起,适配Android Wear,支持Android穿戴设备,新增室内图相关功能。
网络地图Android SDK提供的所有服务是免费的,接口使用无次数限制。您需申请密钥(key)后, 才可使用网络地图Android SDK。任何非营利性产品请直接使用,商业目的产品使用前请参考使用须知。
在您使用网络地图Android SDK之前,请先阅读网络地图API使用条款。
⑶ 安卓百度地图应用添加覆盖层问题(高分在线等)
一般view都是在activity的oncreat方法中进行初始化,如果你的mMapView也是这样的话,应该是在oncreat里面写这句话。
如果不是这样,那就在覆盖层显示之前添加这句话,要不然没法显示了!
⑷ android 百度地图上怎么画线,画圆
//代码如下
importandroid.content.Context;
importandroid.graphics.Canvas;
importandroid.graphics.Color;
importandroid.graphics.Paint;
importandroid.graphics.Paint.Style;
importandroid.graphics.Path;
importandroid.graphics.Point;
importandroid.os.Bundle;
importcom..mapapi.BMapManager;
importcom..mapapi.GeoPoint;
importcom..mapapi.MapActivity;
importcom..mapapi.MapController;
importcom..mapapi.MapView;
importcom..mapapi.Overlay;
importcom..mapapi.Projection;
{
privateContextmContext;
privateMapViewmapView;
@Override
(){
//TODOAuto-generatedmethodstub
returnfalse;
}
privateGeoPointgpoint1,gpoint2,gpoint3;//连线的点
@Override
protectedvoidonCreate(Bundlearg0){
super.onCreate(arg0);
setContentView(R.layout.map_layout);
BaseApplicationbaseApp=(BaseApplication)this.getApplication();
if(baseApp.mBMapManage==null){
baseApp.mBMapManage=newBMapManager(mContext);
baseApp.mBMapManage.init(baseApp.mStrKey,
newBaseApplication.MyGeneralListener());
}
baseApp.mBMapManage.start();
super.initMapActivity(baseApp.mBMapManage);//初始化mapsdk
mapView=(MapView)findViewById(R.id.bmapView);
mapView.setBuiltInZoomControls(true);
//设置在缩放动画过程中也显示overlay,默认为不绘制
mapView.setDrawOverlayWhenZooming(true);
//RouteLinerouteLine=
//(RouteLine)getIntent().getSerializableExtra("routeLine");
//这里画点和连接线
MyOverlaymyOverlay=newMyOverlay();
mapView.getOverlays().add(myOverlay);
MapControllermapController=mapView.getController();
mapController.zoomIn();
gpoint1=newGeoPoint((int)(2259316*10),
(int)(11396279*10));
gpoint2=newGeoPoint((int)(2259245*10),
(int)(11396226*10));
gpoint3=newGeoPoint((int)(2259121*10),
(int)(11396066*10));
mapController.animateTo(gpoint1);//设置一个起点
}
classMyOverlayextendsOverlay{
@Override
publicvoiddraw(Canvascanvas,MapViewmapView,booleanshadow){
super.draw(canvas,mapView,shadow);
Projectionprojection=mapView.getProjection();
Pointp1=newPoint();
Pointp2=newPoint();
Pointp3=newPoint();
//经度转像素
projection.toPixels(gpoint1,p1);
projection.toPixels(gpoint2,p2);
projection.toPixels(gpoint3,p3);
//第一个画笔画圆
PaintfillPaint=newPaint();
fillPaint.setColor(Color.BLUE);
fillPaint.setAntiAlias(true);
fillPaint.setStyle(Style.FILL);
//将图画到上层
canvas.drawCircle(p1.x,p1.y,5.0f,fillPaint);
canvas.drawCircle(p2.x,p2.y,5.0f,fillPaint);
canvas.drawCircle(p3.x,p3.y,5.0f,fillPaint);
//第二个画笔画线
Paintpaint=newPaint();
paint.setColor(Color.BLUE);
paint.setDither(true);
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeJoin(Paint.Join.ROUND);
paint.setStrokeCap(Paint.Cap.ROUND);
paint.setStrokeWidth(4);
//连接
Pathpath=newPath();
path.moveTo(p1.x,p1.y);
path.lineTo(p2.x,p2.y);
path.lineTo(p3.x,p3.y);
//画出路径
canvas.drawPath(path,paint);
}
}
}
⑸ android 开发使用最新百度地图如何画轨迹
android 使用网络地图画轨迹
java">importandroid.content.Context;
importandroid.graphics.Canvas;
importandroid.graphics.Color;
importandroid.graphics.Paint;
importandroid.graphics.Paint.Style;
importandroid.graphics.Path;
importandroid.graphics.Point;
importandroid.os.Bundle;
importcom..mapapi.BMapManager;
importcom..mapapi.GeoPoint;
importcom..mapapi.MapActivity;
importcom..mapapi.MapController;
importcom..mapapi.MapView;
importcom..mapapi.Overlay;
importcom..mapapi.Projection;
{
privateContextmContext;
privateMapViewmapView;
@Override
(){
//TODOAuto-generatedmethodstub
returnfalse;
}
privateGeoPointgpoint1,gpoint2,gpoint3;//连线的点
@Override
protectedvoidonCreate(Bundlearg0){
super.onCreate(arg0);
setContentView(R.layout.map_layout);
BaseApplicationbaseApp=(BaseApplication)this.getApplication();
if(baseApp.mBMapManage==null){
baseApp.mBMapManage=newBMapManager(mContext);
baseApp.mBMapManage.init(baseApp.mStrKey,
newBaseApplication.MyGeneralListener());
}
baseApp.mBMapManage.start();
super.initMapActivity(baseApp.mBMapManage);//初始化mapsdk
mapView=(MapView)findViewById(R.id.bmapView);
mapView.setBuiltInZoomControls(true);
//设置在缩放动画过程中也显示overlay,默认为不绘制
mapView.setDrawOverlayWhenZooming(true);
//RouteLinerouteLine=
//(RouteLine)getIntent().getSerializableExtra("routeLine");
//这里画点和连接线
MyOverlaymyOverlay=newMyOverlay();
mapView.getOverlays().add(myOverlay);
MapControllermapController=mapView.getController();
mapController.zoomIn();
gpoint1=newGeoPoint((int)(2259316*10),
(int)(11396279*10));
gpoint2=newGeoPoint((int)(2259245*10),
(int)(11396226*10));
gpoint3=newGeoPoint((int)(2259121*10),
(int)(11396066*10));
mapController.animateTo(gpoint1);//设置一个起点
}
classMyOverlayextendsOverlay{
@Override
publicvoiddraw(Canvascanvas,MapViewmapView,booleanshadow){
super.draw(canvas,mapView,shadow);
Projectionprojection=mapView.getProjection();
Pointp1=newPoint();
Pointp2=newPoint();
Pointp3=newPoint();
//经度转像素
projection.toPixels(gpoint1,p1);
projection.toPixels(gpoint2,p2);
projection.toPixels(gpoint3,p3);
//第一个画笔画圆
PaintfillPaint=newPaint();
fillPaint.setColor(Color.BLUE);
fillPaint.setAntiAlias(true);
fillPaint.setStyle(Style.FILL);
//将图画到上层
canvas.drawCircle(p1.x,p1.y,5.0f,fillPaint);
canvas.drawCircle(p2.x,p2.y,5.0f,fillPaint);
canvas.drawCircle(p3.x,p3.y,5.0f,fillPaint);
//第二个画笔画线
Paintpaint=newPaint();
paint.setColor(Color.BLUE);
paint.setDither(true);
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeJoin(Paint.Join.ROUND);
paint.setStrokeCap(Paint.Cap.ROUND);
paint.setStrokeWidth(4);
//连接
Pathpath=newPath();
path.moveTo(p1.x,p1.y);
path.lineTo(p2.x,p2.y);
path.lineTo(p3.x,p3.y);
//画出路径
canvas.drawPath(path,paint);
}
}
}
⑹ android 百度地图 怎么添加overlay
新建一个OverlayItem , 调用它的setMarker给它传个图片,再用ItemizedOverlay.addItem()把新建的OverlayItem加进去,最后刷新一下地图就可以了。你可以看看官方Demo中的ItemizedOverlayDemo .
⑺ android百度地图api3.0 清除覆盖物的方法
mBaiMap.clear();
或者是
Marker
marker
=
(Marker)mBaiMap.addOverlay(option);
marker.remove();
你的采纳是我前进的动力,
记得好评和采纳,答题不易,互相帮助,
手机提问的朋友在客户端右上角评价点(满意)即可.
如果你认可我的回答,请及时点击(采纳为满意回答)按钮!!
⑻ android开发的时候,百度地图api里的MyLocationOverlay这个类错误
不知道你是不是没有使用正确.你可以参考下我的代码
//继承MyLocationOverlay重写dispatchTap实现点击处理
public class locationOverlay extends MyLocationOverlay{
public locationOverlay(MapView mapView) {
super(mapView);
// TODO Auto-generated constructor stub
}
@Override
protected boolean dispatchTap() {
// TODO Auto-generated method stub
//处理点击事件,弹出泡泡
popupText.setBackgroundResource(R.drawable.popup);
popupText.setText("我的位置");
pop.showPopup(BMapUtil.getBitmapFromView(popupText),
new GeoPoint((int)(locData.latitude*1e6), (int)(locData.longitude*1e6)),
8);
return true;
}
}
//定位图层
locationOverlay myLocationOverlay = null;//实例变量
//定位图层初始化
myLocationOverlay = new locationOverlay(mMapView);//在oncreate中初始化
mMapView.getOverlays().add(myLocationOverlay);//添加到地图上
myLocationOverlay.setLocationMode(LocationMode.FOLLOWING);
//更新定位数据
myLocationOverlay.setData(locData);//这个一般定位成功调用
⑼ 怎样使用百度地图Android SDK将多个坐标信息同时显示在地图上
就是显示多个标而已,向map中增加多个覆盖物,网络的demo不是有一个就是增加标注,增加覆盖物的,有现成的代码,不要问别人了,直接下载网络map的开发示例
或淘宝搜9055635,里面有教程