本文介绍了Android谷歌地图标记/标签类似于最新的流量图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我在android上使用谷歌地图很新颖。到目前为止,我找到了以下代码片段。 public void onMapReady(GoogleMap googleMap){ mMap = googleMap; //在悉尼添加一个标记并移动相机 LatLng sydney = new LatLng(-34,151); mMap.addMarker(new MarkerOptions()。position(sydney).title(Marker in Sydney)); mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney)); } 这是标记的简单标记。我正在看的是类似于下面的图片。我想要做的是如何显示标签或inforwindow,如显示交通堵塞如何分钟+8分钟等。我不太确定是否要做标签,自定义信息窗口或如何? 解决方案 1。确保您在Google地图中检测到您的当前位置 2.确保您的Google地图有可用于您当前位置的流量数据。 2.确保您的互联网连接可用于您的设备。 @Override public void onMapReady(GoogleMap googleMap){ mMap = googleMap; mMap.setTrafficEnabled(true); //交通线路在mapview中 $ bI am quite new to using google map on android. So far I found the following code snippet.public void onMapReady(GoogleMap googleMap) { mMap = googleMap; // Add a marker in Sydney and move the camera LatLng sydney = new LatLng(-34, 151); mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney")); mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney)); }This does a simple labelling of the marker. What I am looking is something like the picture below.What I want to do is how to show the label or inforwindow like its shows the traffic jam how minutes +8 min etc. I am not too sure is it to be done a label, custom info window or how? 解决方案 1. Make sure your current location is detected in Google Map2.Make sure your Google Map has traffic data available for your current location.2.Make sure your Internet Connection is available for your Devices.@Override public void onMapReady(GoogleMap googleMap) { mMap = googleMap; mMap.setTrafficEnabled(true);// Traffic line is on in mapview } 这篇关于Android谷歌地图标记/标签类似于最新的流量图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-12 02:50