Android的 - 在我的谷歌地图的中心显示十字线 [英] Android - Showing a crosshair in the center of my Google Map
问题描述
我有一个谷歌地图和ItemizedOverlay一个应用程序用来显示一些标记(从图形页面官方教程)。我需要你的帮助,这:我想在上面总是显示十字和中心在地图上,即使在地图平移
I have an app with a Google Map and a ItemizedOverlay used to show some markers (From the MapView official tutorial). I need your help with this: I want to show a crosshair always on top and centered on the map, even when the map is panned.
我已阅读本主题:<一href=\"http://stackoverflow.com/questions/3151218/android-creating-a-crosshair-in-the-center-of-my-google-map\">Android - 创建我的谷歌地图的中心的十字线但对如何使用code回答没有解释
I have read this topic: Android - Creating a Crosshair in the Center of My Google Map but there is no explanation on how to use the code answered.
先谢谢了。
推荐答案
步骤#1:无论是覆盖
类,从这个问题的答案到你的项目中复制
Step #1: Copy either of the Overlay
classes from that answer into your project.
第二步:通过你的
,就像你添加你自己的图形页面
的覆盖
类的一个实例添加getOverlays()。添加() ItemizedOverlay
。
Step #2: Add an instance of that Overlay
class to your MapView
via getOverlays().add()
, just like you are adding your own ItemizedOverlay
.
第三步:有没有步骤#3
Step #3: There is no step #3.
这假定其样本code工作,而我还没有尝试过。
This assumes that their sample code works, and I have not tried it.
这篇关于Android的 - 在我的谷歌地图的中心显示十字线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!