【问题标题】:Custom markers icons not displayed on android [closed]android上未显示自定义标记图标[关闭]
【发布时间】:2020-06-04 19:32:11
【问题描述】:

我有这个代码:

this.service.getListe(data).forEach((data: any) => {
    const marker: Marker = this.map.addMarkerSync(data);
    marker.on(GoogleMapsEvent.MARKER_CLICK).subscribe((params) => {
        this.click(params);
    });
});

现在getListe() 看起来像:

getListe(merchants: any) {
    const Liste: BaseArrayClass<any> = new BaseArrayClass<any>();
    merchants.map(item => {
        Liste.push({
            title: item.name,
            animation: 'DROP',
            position: {
                lat: item.lat,
                lng: item.long
            },
            icon: 'http://icons.iconarchive.com/icons/iconarchive/red-orb-alphabet/24/Number-1-icon.png',
            disableAutoPan: true
        });
    });

    return Markers;
}

我试过并且喜欢这样:

icon: {
    url: 'http://icons.iconarchive.com/icons/iconarchive/red-orb-alphabet/24/Number-1-icon.png'
}

但同样的行为,问题是在模拟器和真实设备上,图标没有改变。在浏览器模式下,我有标记我在 BaseArrayClass 中指示的正确图标,但在模拟器上我有默认图标。你对此有什么想法吗?

【问题讨论】:

  • 尝试使用https的网址
  • 应用程序在控制台显示一些错误?
  • 不…………
  • 适用于 https,非常感谢...

标签: angular google-maps ionic-framework ionic3


【解决方案1】:

尝试使用https协议找到一些图标。

Google 可能不允许使用不安全的网址。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-05-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-26
    相关资源
    最近更新 更多