开发者

MapView and Traffic

I’m trying to add the traffic feature on my map with the setTraffic method, but without any changes. At the beginning I thought that for the area that I'm showing (Sydney) there wasn’t this feature, but after that I checked on Google Earth I saw that the traffic is correctly showed.

A开发者_如何转开发ny advice or any alternative solution?

MapView myMapView = (MapView) findViewById(R.id.myMapView);
mapController = myMapView.getController();

myMapView.setSatellite(true);
myMapView.setStreetView(false);
myMapView.displayZoomControls(true);
myMapView.setBuiltInZoomControls(true);
myMapView.setTraffic(true);


I think I'm having the same(similar) issue over at this question >>> Why doesn't Google's MapView show traffic outside of the USA on Android 2.2?

Having run some tests it appears the MapView component in Android 2.2 does not show traffic outside of the United States whereas it does show it in Android 2.3.3.

Well, specifically I can state that using code identical to your's the above statement is true. It remains to be seen if there is an alternative way to get the non-USA traffic displaying.


I tried your code and it worked properly. Try calling invalidate on your MapView after changing the overlays:

myMapView.invalidate();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜