是否有可能表现出的Andr​​oid谷歌地图API V2 /隐藏标记? [英] Is it possible to show/hide Markers in Android Google maps api v2?

查看:149
本文介绍了是否有可能表现出的Andr​​oid谷歌地图API V2 /隐藏标记?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想(在我使用谷歌地图API V2 Android应用程序)根据类别隐藏或我的GoogleMap对象显示标记,就像在谷歌地图API的网站,例如:

I would like (in my Android app using Google maps api v2) to hide or show markers on my GoogleMap object according to a category, just like in the google maps web api, for example:

我有一个50标记,其中20重新present餐馆使用GoogleMap,20它们重新present巴士站和10是电影院。

I have a GoogleMap with 50 Markers, 20 of them represent restaurants, 20 them represent bus stops, and 10 are cinemas.

是否有可能在Android谷歌地图API V2做过滤这些标志物,通过隐藏所有的餐厅标志,如果我们取消选中,例如一个复选框?

Is it possible on Android google maps api v2 to do filtering on these markers, by hiding all the restaurant markers if we un-tick a checkbox for example?

我愿做这样的事情,但我使用谷歌地图API V2 Android设备上:的 HTTP://www.geo$c$czip.com/v3_MW_example_categories.html

I would like to do something like that but on my Android device using google maps api v2: http://www.geocodezip.com/v3_MW_example_categories.html

抱歉的基本问题,但我是一个初学者。

Sorry for the basic question but I am a beginner.

推荐答案

试试这个方法。

 Marker restuarantMarkers = gMap.addMarker(new MarkerOptions()
                .position(latlng)
                .title("MyPlace").icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_pin)).draggable(true));

On Click事件

  restuarantMarkers.setVisible(false);

此方法可以使用​​循环做。

This way can do using loop..

让我知道,如果你的作品。

Let me know if it works for you.

这篇关于是否有可能表现出的Andr​​oid谷歌地图API V2 /隐藏标记?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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