Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/189.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 谷歌地图没有';不能显示正确的位置_Android_Google Maps_Google Maps Api 2 - Fatal编程技术网

Android 谷歌地图没有';不能显示正确的位置

Android 谷歌地图没有';不能显示正确的位置,android,google-maps,google-maps-api-2,Android,Google Maps,Google Maps Api 2,不久前,我在我的应用程序上更新了我的地图类,使用谷歌地图Android API v2。在我的应用程序中,我使用类位置保存我的当前位置。当我试图在地图上添加一个带有我所在位置的标记时,代码为: Log.e(tag,"adding user_marker at lat = " + Common.curLocation.getLatitude() + ",lng = " + Common.curLocation.getLongitude()); User_Curr_Position = new La

不久前,我在我的应用程序上更新了我的地图类,使用谷歌地图Android API v2。在我的应用程序中,我使用类位置保存我的当前位置。当我试图在地图上添加一个带有我所在位置的标记时,代码为:

Log.e(tag,"adding user_marker at lat = " + Common.curLocation.getLatitude() 
+ ",lng = " + Common.curLocation.getLongitude());
User_Curr_Position = new LatLng(Common.curLocation.getLatitude(),
  Common.curLocation.getLatitude());
mUser_Curr_Position_Marker = mMap.addMarker(new 
MarkerOptions().position(User_Curr_Position).title("Your Position").draggable(true));
它给了我错误的位置(在深海的某个地方)。通过从日志中获取lat和long(“在lat=32.165603,lng=34.81224处添加用户_标记”),我检查了是否输入了错误的参数,并在谷歌地图(互联网上)上找到了正确的位置。
有人能告诉我我做错了什么吗?

好吧,您正在输入用户的纬度作为经度

User_Curr_Position = new LatLng(Common.curLocation.getLatitude(),  Common.curLocation.getLatitude());
这是必须的

User_Curr_Position = new LatLng(Common.curLocation.getLatitude(),  Common.curLocation.getLongitude());

有时,另一个人可以看到你面前的一切。。。我的错…谢谢