Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/31.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
JQuery Mapael在错误位置显示工具提示_Jquery_Angular_Mapael - Fatal编程技术网

JQuery Mapael在错误位置显示工具提示

JQuery Mapael在错误位置显示工具提示,jquery,angular,mapael,Jquery,Angular,Mapael,我正在使用JQuery Mapaeal以5 pr的角度制作一个交互式地图,我正在向地图的每个区域添加工具提示,但这是在我将鼠标放在该区域上时发生的 在这张图片中,我将鼠标放在左下角区域(鼠标没有出现在打印中)。 我希望它像普通的工具提示一样出现在鼠标附近 这是我的代码: html文件: <div class="container" id="background" style="display: table;"> <div class ="mapcontainer" style

我正在使用JQuery Mapaeal以5 pr的角度制作一个交互式地图,我正在向地图的每个区域添加工具提示,但这是在我将鼠标放在该区域上时发生的

在这张图片中,我将鼠标放在左下角区域(鼠标没有出现在打印中)。 我希望它像普通的工具提示一样出现在鼠标附近

这是我的代码:

html文件:

<div class="container" id="background"  style="display: table;">
<div class ="mapcontainer" style="display: table-row">
    <div class="map" style="display: table-cell;">Alternative content</div>

    <div class="areaLegend" style="display: table-cell; float: left;">
        <span>Alternative content for the legend</span>
    </div>
</div>
Css文件被调用了吗?我不确定(还不擅长CSS) 已经谢谢你了

    initMap(){
    $(".mapcontainer").mapael({
        map: {
            name: "portugal",
            defaultArea: {
                attrs : {
                    stroke : "#fff", 
                    "stroke-width" : 1
                },
                attrsHover : {
                    "stroke-width" : 2
                }
            }
        },
        legend: {
            area: {
                title: TITLE,
                slices: [
                    {
                        max: 1,
                        attrs: {
                            fill: "#01c602"
                        },
                        label: LABEL1,
                    },
                    {
                        min: 2,
                        max: 2,
                        attrs: {
                            fill: "#d5dd2b"
                        },
                        label: LABEL2,
                    },
                    {
                        min: 3,
                        max: 3,
                        attrs: {
                            fill: "#FFA500"
                        },
                        label: LABEL3,
                    },
                    {
                        min: 4,
                        attrs: {
                            fill: "#FF0000"
                        },
                        label: LABEL4,
                    }
                ]
            }
        },
        areas: {
            "PT-01": {
                value: this.PT01,
                href: "#",
                tooltip: {

                     content : "<span style=\"font-weight:bold;\">Nord (59)</span><br />Population : 2617939"
                }
            }
        }
});
}
 .mapTooltip {
    position : fixed;
    background-color : #fff;
    moz-opacity:0.70;
    opacity: 0.70;
    filter:alpha(opacity=70);
    border-radius:10px;
    padding : 10px;
   z-index: 1000;
   max-width: 200px;
   display:none;
   color:#343434;}

   .container {
      max-width: 800px;
      margin:auto; }

   body {
      font-family:Helvetica,Arial,sans-serif;
   }