HERE-API如何在信息块尾部添加元素

时间:2015-08-04 19:11:40

标签: here-api

我想在.nm_bubble_tail

中添加一个SPAN元素
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尾部。

1 个答案:

答案 0 :(得分:0)

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

示例(用你的头像替换内置尾部):

  <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>