【问题标题】:Cannot use setData()无法使用 setData()
【发布时间】:2015-12-19 10:05:12
【问题描述】:

对于我的一生,我无法弄清楚如何将 setData() 用于标记。

我的代码:

MarkerOptions markerOptions = new MarkerOptions().position(position).title(title).snippet(snippet);

Marker marker = map.addMarker(markerOptions);

marker.setData(data); // This doens't work, simply says cannot resolve.

我的 build.gradle 中有以下内容:

compile 'com.androidmapsextensions:android-maps-extensions:2.2.0'
compile 'com.google.android.gms:play-services-maps:7.8.0'
compile 'com.google.android.gms:play-services-location:7.8.0'

我到底如何使用 setData?!

【问题讨论】:

标签: java android google-maps-android-api-2 android-maps-extensions


【解决方案1】:

来自 Android Maps Extensions 迁移“指南”:

迁移到扩展程序时,您所要做的只是:

  • 几个导入语句,
  • SupportMapFragment(或 MapView)xml 中的完整类名和
  • SupportMapFragment(或MapView)上调用getExtendedMap 而不是getMap

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多