更改Google Maps ui-gmap-markers

时间:2019-05-09 10:53:33

标签: angularjs google-maps angularjs-directive google-maps-markers

如何更改html中的标记图标?指令代码和html代码如下。

        vm.events = [];
        vm.map = {
            center : {
                latitude: vm.location.latitude,
                longitude: vm.location.longitude,
            },
            options: {
              icon: "https://s3.amazonaws.com/cidewalk-cdn/img/person.png"
            }
        }
        vm.icon = "https://s3.amazonaws.com/cidewalk-cdn/img/person.png";

HTML代码在下面。我试图将其同时映射到vm.icon和vm.map.options.icon,但没有用

         <div class="col-md-8 col-sm-12 hidden-sm hidden-xs live-feed-map">
            <div class="panel panel-default">
                <div class="panel-body">
                    <ui-gmap-google-map center="vm.map.center" zoom="10" style="height: 400px">
                        <ui-gmap-markers coords="'self'" icon="vm.map.options.icon" models="vm.events"></ui-gmap-markers>
                    </ui-gmap-google-map>
                </div>
            </div>
        </div>

0 个答案:

没有答案