【问题标题】:Angular Google Maps component Icon is not workingAngular Google Maps 组件图标不起作用
【发布时间】:2021-04-10 14:14:24
【问题描述】:

我使用Angular Google Maps component,除自定义图标外,其他一切工作正常。我已经设置如下。你能告诉我为什么它不起作用吗?

 mapOptions = {
            center: { lat: store.latitude, lng: store.longitude },
            zoom: 11,
            mapId: environment.googleMapId,
            icon: 'https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png',
            

        } as google.maps.MapOptions;

【问题讨论】:

    标签: angular typescript google-maps ionic-framework


    【解决方案1】:

    我的错。我需要将其设置在MarkerOptions 下,如下所示:

    markerOptions: {
                    icon: {
                        url:
                            'https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png',
                       
    
                    }, draggable: false
                }
    

    【讨论】:

      猜你喜欢
      • 2021-10-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-03
      • 2017-12-21
      • 1970-01-01
      相关资源
      最近更新 更多