關於com.google.android.maps.MyLocationOverlay 問題

sky663 sky663 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区


MapView mapview = (MapView) findViewById(R.id.map_mymap);
mapview.setClickable(true);
mapview.setEnabled(true);
mapview.setBuiltInZoomControls(true);

MapController controller = mapview.getController();
controller.setZoom(16);

MyLocationOverlay myoverlay = new MyLocationOverlay(this,mapview);

myoverlay.enableMyLocation();

mapview.getOverlays().add(myoverlay);


這個MyLocationOverlay 加上去一點作用也沒有。
照官方文檔上講應該至少會給我畫一個 藍色的小圓點出來呀,什麼都沒有?

Draw the "my location" dot. By default, draws an animated "blue dot" asset, possibly surrounded by an outlining blue disk to represent accuracy. Also, if the user's position moves near the edge of the screen, and we've been given a MapController in our constructor, we'll scroll to recenter the new reading.

難道要我重寫 MyLocationOverlay 類嗎?
要是這樣的話,那跟 重寫 ItemizedOverlay 有什麼區別啊。鬱悶中。。。。
...全文
评论 14
收藏 已收藏
分享
返回顶部
sky663
Android 80,489 成员 91,375 内容