HERE-API 如何向信息气泡尾部添加元素

HERE-API How do I add an element to the infobubble tail

我想将 SPAN 元素添加到 .nm_bubble_tail

NokiaHere.prototype.createMap = function(container, callback) {
  var _callback = callback;
  var that = this;
  this.infoBubbles = new nokia.maps.map.component.InfoBubbles();

  nokia.Settings.set("app_id", this.appId);
  nokia.Settings.set("app_code", this.appCode);
  (document.location.protocol == "https:") && nokia.Settings.set("secureConnection", "force");

  var map = new nokia.maps.map.Display(
    container, {
      components: [
            this.infoBubbles,
            new nokia.maps.map.component.Behavior(),
            new nokia.maps.map.component.ZoomBar(),
            new nokia.maps.map.component.Overview(),
            new nokia.maps.map.component.ScaleBar()
          ]
    }
  );
  this.group = new nokia.maps.map.Container();
  _callback(map);
};

我想用图片自定义我的 infobubble 尾巴。

添加图片很简单,你可以使用CSS。

示例(用您的头像替换 built-in 尾巴):

  <style>
  .nm_bubble_tail{
    /*bring the tail into front*/
    z-index:1000 !important;
  }
  .nm_bubble_tail::after{
    /*add the desired image*/
    content:url(https://www.gravatar.com/avatar/e0865f23aafa1793842a13e12ab443bd?s=32&d=identicon&r=PG&f=1);
  }
  .nm_bubble_tail canvas{
    /*hide the original tail*/
    display:none;
  }
  </style>