0

我在 Angular js 中使用 Ngmap,它工作正常,但需要在我的 html 中有图像映射

Html 图像映射:

    <img class="map" src="demo_usa.png" width="960" height="593" usemap="#usa" usemap="#usa">
    <map name="usa">
        <area href="#" title="HI" shape="poly" coords="225,521, 227,518, 229,517, 229,518, 227,521, 225,521" ng-click="StateSelect(1)">
    </map>

上面的标签显示图像地图,但它也显示谷歌地图,我在地图标签上使用了ng-non- bindable,它解决了这个问题,但它也禁用了区域标签上的 ng-click="StateSelect(1)"。

Angular Ng-map

            <ng-map center="{{House.Latitude}},{{House.Lonitude}}">

                <shape name="circle" no-watcher="true"
                       stroke-color="#23b079"
                       stroke-opacity="0.8"
                       stroke-weight="2"
                       fill-color="#23b079"
                       fill-opacity="0.35"
                       center="{{House.Latitude}},{{House.Lonitude}}"
                       radius="300">
                </shape>

                @*<marker position="[{{House.Latitude}},{{House.Lonitude}}]"></marker>*@

            </ng-map>

Angular Ng-map 工作正常问题是html Image map,它还显示 google map 而不是 html image map 。

任何解决方案?

谢谢你 。

4

1 回答 1

0

我遇到了和你一样的问题。您可以在模块配置中终止 map 指令:

.directive('map', function(){
    return {
        priority: 99,
        terminal: true,
    };
})

注意:这样做<map>会失去 ng-map 的能力,你必须使用<ng-map>google-map。

于 2017-01-05T15:48:32.700 回答