如何在Google地图的屏幕中央放置标记 [英] How to place a Marker on center of the screen on google map

查看:103
本文介绍了如何在Google地图的屏幕中央放置标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将标记放置在google map android的屏幕中央,就像在uber和ola应用中一样.移动或滚动时,谷歌地图标记不应移动,并且应提供纬度坐标

Place marker on center of the screen on google map android same as like in uber and ola apps. When moving or scrolling a google map marker should not move and it should give latlng coordinates

推荐答案

您需要将ImageView放置在frameLayout的中心.它不是地图的标记,而是放置在中心,当您单击该图像视图时,您需要获取地图的中心LatLng

You need to put an ImageView center of frameLayout.That is not marker of your map but it place in the center and when you click that imageview you need to get center LatLng of the map

以下是获取地图中心LatLng的代码:

Here is code for getting center LatLng of map :

LatLng center = mgoogleMap.getCameraPosition().target;

LatLng center = mgoogleMap.getCameraPosition().target;

这篇关于如何在Google地图的屏幕中央放置标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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