Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我构建了一个 ListActivity,现在我想将地图预览添加为列表图标。我不想扩展 MapView,因为:第一,我只需要一点静态预览,第二,我已经扩展到 ListView。
我已经研究过使用静态地图 api,但是在那个小尺寸上看起来也不是很好:
http://maps.google.com/maps/api/staticmap?center=40.714728,-73.998672&zoom=12&size=65x65&maptype=roadmap&sensor=true
抱歉,Android 中没有任何东西可以生成地图预览。为此,您将需要使用一些 Web 服务。
您可以在布局中使用 MapView 并使用
map:liteMode="true"
您不需要扩展 MapView,只需在布局中设置上述内容即可轻松使用视图。例如。myMapView.onCreate()、myMapView.getMapAsync() 等。