如何与我在Android的谷歌地图V2图标替换蓝点? [英] How to replace blue dot with my icon on google maps v2 in android?
本文介绍了如何与我在Android的谷歌地图V2图标替换蓝点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想用我自己的谷歌地图V2图标替换蓝点(这在地图上显示当前位置)。我曾尝试以下,但没有奏效。
- <一个href="http://stackoverflow.com/questions/14826345/android-maps-api-v2-change-mylocation-icon">Android地图API V2变化MyLocation图标
- 地图V2 myLocation蓝点回调
- <一个href="http://stackoverflow.com/questions/14376361/disable-center-button-in-mylocation-at-google-map-api-v2">Disable在MyLocation在谷歌地图API V2中间的按钮
应该是这样的
下面没有工作
位图B = BitmapFactory.de codeResource(getResources()
R.drawable.location_arrow1);
googleMap.addMarker(新MarkerOptions()。位置(myPosition)
.title伪(getIntent()。getStringExtra(FIRST_NAME))
.icon(BitmapDescriptorFactory.fromBitmap(B)));
解决方案
您必须停止使用 GoogleMap.setMyLocationEnabled
,写多一点code,其中包括 接收位置更新
你自己和添加圆
的准确性。
I am trying to replace blue dot (which shown current location on maps) with my own icon on Google maps v2. I have tried below, none worked.
- Android Maps API v2 Change MyLocation Icon
- Maps V2 myLocation blue dot callback
- Disable center button in MyLocation at Google Map API V2
Should look like this
Below did not work
Bitmap b = BitmapFactory.decodeResource(getResources(),
R.drawable.location_arrow1);
googleMap.addMarker(new MarkerOptions().position(myPosition)
.title(getIntent().getStringExtra("first_name"))
.icon(BitmapDescriptorFactory.fromBitmap(b)));
解决方案
You will have to stop using GoogleMap.setMyLocationEnabled
and write a bit more code, including receiving location updates
on your own and adding Circle
for accuracy.
这篇关于如何与我在Android的谷歌地图V2图标替换蓝点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文