【问题标题】:Temperature module in aeris weather frameworkaeris 天气框架中的温度模块
【发布时间】:2018-11-25 13:24:00
【问题描述】:

我想在 aeris 天气框架中使用以下代码以摄氏度而不是默认华氏度显示温度。

var aerisMapBuilder = new aeris.interactive.MapAppBuilder({
    apiId:'key1',
    apiSecret:'key2',
    el: '#map-canvas',
    modules: {
        map: {
            zoom: 9,
            center: [37.6436,22.4918],
            scrollZoom: true,
        },
        geosearch: {
            geolocate: true
        },
        localWeather: {
            showOnInit: true
        },
        mapControls: {
            expandOnInit: false,
            groups: ['Points']
        },
       layers: {
            objects: [
                {
                    type: 'SatelliteGlobal',
                    selected: true,
                    opacity: .90

                }

            ]
        } 
    }
});

任何想法都会对我有很大帮助!

问候

【问题讨论】:

    标签: weather temperature


    【解决方案1】:

    API 文档建议设置本地单位。参考1: Configuration Options

    建议使用下面的函数来设置JS中的单位类型

    Aeris.wxblox.config.set('unitsType', 'Units.Type.Imperial');
    

    【讨论】:

    • 它建议您正确地说以下功能,但在我的情况下 Aeris.wxblox.config.set('unitsType', 'Units.Type.Metric');老实说,我不知道将它放在我的文件中的哪个位置,从而成功地工作。我试图在最后使用它 - 开始但没有运气.....
    • 您在调用上述函数后是否尝试过aerisMapBuilder.config.set('unitsType', 'Units.Type.Metric')?
    • 我已经和他们谈过了。目前还不能使用我自己的模板。
    猜你喜欢
    • 1970-01-01
    • 2021-06-02
    • 1970-01-01
    • 2022-01-11
    • 2013-02-05
    • 2017-03-06
    • 2018-08-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多