信息窗口被卡在左上方的NgMap中

时间:2016-07-27 19:37:44

标签: html angularjs google-maps infowindow ng-map

这是我的代码:

<ng-map center="37.09024, -95.712891" zoom="4" mayTypeId="ROADMAP" style="height: 88%; width: 100%" styles="{{model.styles}}"
                pan-control="false"
                map-type-control="false"
                map-type-control-options="false"
                zoom-control="true"
                zoom-control-options="false">


            <custom-marker ng-repeat="coach in model.coaches track by $index"
                    id="custom-{{$index}}"
                    on-mouseover="model.showinfowindow(event,$index)"
                    on-mouseout="model.hideinfowindow()"
                    on-click="model.viewMapProfile(coach)"
                    position={{coach.mapCoordinates}}>


                   <img src="views/players/profile/scout.png" style="height: 40px">

            </custom-marker>

            <info-window id="foo">
                <div ng-non-bindable="">
                    <div align="center" class="mapViewProfile" style="padding-left: 20px">
                        {{model.coach.name}}<br>
                    </div>
                </div>
            </info-window>

        </ng-map>

这是我的控制器功能:

vm.showinfowindow = function (evt, id) {
        vm.coach = vm.coaches[id];
        vm.map.showInfoWindow('foo', this);
    };

    vm.hideinfowindow = function () {
        vm.map.hideInfoWindow('foo');
    };

信息窗口卡在左上角。事情是它与默认标记工作正常。但不是自定义标记。

0 个答案:

没有答案