【问题标题】:Bing Maps - How do I change font family on map labels?必应地图 - 如何更改地图标签上的字体系列?
【发布时间】:2021-09-11 23:08:31
【问题描述】:

根据这些准则:
https://docs.microsoft.com/en-us/bingmaps/styling/map-style-sheet-entry-properties#mapelement-properties

我正在尝试设置地图样式。除“fontFamily”外,所有属性均正常工作 我暂时使用这种 go​​ogle 字体,但我也尝试过 'serif'、'Times' 和 'Times New Roman',它们都没有显示出任何区别。

    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Rye&display=swap" rel="stylesheet">
var sampleStyle = {
    "elements": {
        "mapElement": {
            "labelVisible": true,
            "fontFamily": 'Rye',
            //"fontFamily": 'serif',
            //"fontFamily": 'Times',
            //"fontFamily": 'Times New Roman',
            "labelColor": "#007bff",
        },
    },
    "settings": {
        "landColor": "#F6F4E3"
    },
    "version": "1.0"
};

【问题讨论】:

    标签: css fonts properties bing-maps bing


    【解决方案1】:

    如果您使用此处提供的地图样式表编辑器应用程序https://www.microsoft.com/en-us/p/map-style-sheet-editor/9nbhtcjt72ft,它将显示哪些选项可用于 Web 控件、静态地图和 UWP 地图控件,并为每个选项生成示例代码。

    【讨论】:

      【解决方案2】:

      我认为只有 Bing Maps UWP 地图控件 (Windows) 支持 fontFamily 样式选项。大多数 Bing 地图样式是为 UWP 控件设计的,并且这些样式中只有一部分在 Web SDK 和静态地图图像服务中公开。不幸的是,他们似乎没有在文档中明确指出支持哪些样式。

      【讨论】:

        猜你喜欢
        • 2012-11-16
        • 2022-10-11
        • 1970-01-01
        • 2018-01-22
        • 2018-06-23
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-03-19
        相关资源
        最近更新 更多