HereMaps SDK中的“ MapMarker”类对象未列出Android中的InfoBubble函数

时间:2019-07-18 12:09:43

标签: android here-api

1 个答案:

答案 0 :(得分:0)

正如评论中已经提到的,HERE Mobile Premium SDK不支持InfoBubble,但HERE Starter SDK支持它,但是Starter SDK现在已被弃用。

在Android上,HERE Mobile Premium SDK的替代方法是MapOverlay类(documentation

private Button button;

private void onMapFragmentInitializationCompleted() {
  // retrieve a reference of the map from the map fragment
  map = mapFragment.getMap();
  // Set the map center coordinate to the Vancouver region (no animation)
  map.setCenter(new GeoCoordinate(49.196261, -123.004773, 0.0),
      Map.Animation.NONE);
  // Set the map zoom level to the average between min and max (no
  // animation)
  map.setZoomLevel((map.getMaxZoomLevel() + map.getMinZoomLevel()) / 2);
  // create the button
  button = new Button(this);
  button.setText("TEST");
  // create overlay and add it to the map
  map.addMapOverlay(
      new MapOverlay(button,
          new GeoCoordinate(37.77493, -122.419416, 0.0)));