【问题标题】:Angular OpenLayers - Marker sizeAngular OpenLayers - 标记大小
【发布时间】:2015-09-26 06:05:20
【问题描述】:

是否可以更改标记的自定义图标图像大小? 如果我像这样设置内部样式大小

style: {
    image: {
        icon: {
            anchor: [0.5, 0.5],
            anchorXUnits: 'fraction',
            anchorYUnits: 'fraction',
            opacity: 1,
            size: [12, 12]
            src: 'images/map-marker.png'
            }
        }
    }

它只改变 12px x 12px 的标记大小,但内部图像保持原始大小。 我可以使用指令更改用于标记的图像大小吗?

【问题讨论】:

    标签: angularjs openlayers-3 angular-openlayers


    【解决方案1】:

    经过一番研究,我找到了答案。在 OpenLayers3 ol.style.Icon 中有参数 scale,它可以在 angular-openlayers 指令中使用。

    style: {
        image: {
            icon: {
                anchor: [0.5, 0.5],
                anchorXUnits: 'fraction',
                anchorYUnits: 'fraction',
                opacity: 1,
                scale: 0.5,
                src: 'images/map-marker.png'
                }
            }
        }
    

    我用这个问题寻求帮助How do I decrease the size of Icon in openlayers 3, i am using bing maps

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多