0

I have an image with a map of principal subway in my country. I need that the users can press the stations on image of the map.

My question is, How can I do to put multiple clickable points on the image? These points will be the subway stations.

I find per several hours, but I do not see anything specific.

I searched for many hours and I found these posts:

1.- This question maybe resolver my question, but is very old, This makes me think that there is some more updated functionality.

2.- In this question says that you can use "GoogleMap object and ground overlay" but I found the oficial documentation about Ground Overlay topic and the image with the map is not alone, the image has background google map.

Does anyone know if there is a current tool with which I can solve this?

Thank you very much for your help.

Community
  • 1
  • 1
gquilarque
  • 161
  • 1
  • 5

1 Answers1

0

You can put transparent buttons on top of your imageview at the positions where you want to option a click using a relative layout and then just handle the button clicks.

 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" >

 <ImageView android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@android:drawable/edit_text" />

 <Button android:id="@+id/bottomLeft" android:layout_width="100dip" android:layout_height="100dip" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:background="@android:color/transparent" />

 <Button android:id="@+id/center" android:layout_width="100dip" android:layout_height="100dip" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:background="@android:color/transparent" /> 

<Button android:id="@+id/bottomRight" android:layout_width="100dip" android:layout_height="100dip" android:layout_centerInParent="true" android:background="@android:color/transparent" />

 </RelativeLayout>
Abhriya Roy
  • 1,338
  • 17
  • 23
  • Thanks @Abhriya Roy but, Do you think this solution works when you zoom in on the map image, and for about 60 different clicks are the stations? – gquilarque Jan 15 '17 at 18:22