android 百度地图全景怎么实现的
答案:2 悬赏:70 手机版
解决时间 2021-03-06 18:25
- 提问者网友:喧嚣尘世
- 2021-03-06 15:30
android 百度地图全景怎么实现的
最佳答案
- 五星知识达人网友:煞尾
- 2021-03-06 16:07
package com.mikyou.tools;
import android.app.Application;
import android.content.Context;
import android.widget.Toast;
import com.baidu.lbsapi.BMapManager;
import com.baidu.lbsapi.MKGeneralListener;
import com.baidu.mapapi.SDKInitializer;
public class BaseApplication extends Application {
private static Context mContext;
public static float sScale;
public static int sWidthDp;
public static int sWidthPix;
public BMapManager mBMapManager = null;
private static BaseApplication mInstance;
public static BaseApplication getInstance() {
return mInstance;
}
@Override
public void onCreate() {
super.onCreate();
SDKInitializer.initialize(this);
initEngineManager(this);
mContext = this;
mInstance = this;
sScale = getResources().getDisplayMetrics().density;
sWidthPix = getResources().getDisplayMetrics().widthPixels;
sWidthDp = (int) (sWidthPix / sScale);
}
public void initEngineManager(Context context) {
if (mBMapManager == null) {
mBMapManager = new BMapManager(context);
}
if (!mBMapManager.init(new MyGeneralListener())) {
Toast.makeText(
BaseApplication.getInstance().getApplicationContext(),
"BMapManager!", Toast.LENGTH_LONG).show();
}
}
public static class MyGeneralListener implements MKGeneralListener {
@Override
public void onGetPermissionState(int iError) {
if (iError != 0) {
} else {
}
}
}
}
import android.app.Application;
import android.content.Context;
import android.widget.Toast;
import com.baidu.lbsapi.BMapManager;
import com.baidu.lbsapi.MKGeneralListener;
import com.baidu.mapapi.SDKInitializer;
public class BaseApplication extends Application {
private static Context mContext;
public static float sScale;
public static int sWidthDp;
public static int sWidthPix;
public BMapManager mBMapManager = null;
private static BaseApplication mInstance;
public static BaseApplication getInstance() {
return mInstance;
}
@Override
public void onCreate() {
super.onCreate();
SDKInitializer.initialize(this);
initEngineManager(this);
mContext = this;
mInstance = this;
sScale = getResources().getDisplayMetrics().density;
sWidthPix = getResources().getDisplayMetrics().widthPixels;
sWidthDp = (int) (sWidthPix / sScale);
}
public void initEngineManager(Context context) {
if (mBMapManager == null) {
mBMapManager = new BMapManager(context);
}
if (!mBMapManager.init(new MyGeneralListener())) {
Toast.makeText(
BaseApplication.getInstance().getApplicationContext(),
"BMapManager!", Toast.LENGTH_LONG).show();
}
}
public static class MyGeneralListener implements MKGeneralListener {
@Override
public void onGetPermissionState(int iError) {
if (iError != 0) {
} else {
}
}
}
}
全部回答
- 1楼网友:孤老序
- 2021-03-06 16:30
/ 隐藏logo
view child = mmapview.getchildat(1);
if (child != null && (child instanceof imageview || child instanceof zoomcontrols)){
child.setvisibility(view.invisible);
}
//地图上比例尺
mmapview.showscalecontrol(false);
// 隐藏缩放控件
mmapview.showzoomcontrols(false);
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯