如何与我在Android的谷歌地图V2图标替换蓝点? [英] How to replace blue dot with my icon on google maps v2 in android?

查看:1126
本文介绍了如何与我在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(BitmapDesc​​riptorFactory.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.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆