Openlayers具有击中/触摸区域

时间:2015-08-18 18:56:37

标签: openlayers-3

如何增加功能的命中区域,因为目前只有文字和图标可点击,这使得点击平板电脑设备非常困难。

var iconFeature = new ol.Feature({
        geometry: new ol.geom.Point([this.pixelLocation.x, this.pixelLocation.y]),
        id: i
    });
    var iconStyle = new ol.style.Style({
        image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
            anchor: [0.7, 35],
            anchorXUnits: 'fraction',
            anchorYUnits: 'pixels',
            opacity: 1,
            src: 'assets/pins/pin-teal.png'
        })),
        text: new ol.style.Text({
            text: this.name,

            font: '13px Interstate-Light',
            fill: new ol.style.Fill({color: 'white'}),
            fontSize: "19px",
            textAlign: textA,
            offsetX: textOffX,
            offsetY: -15
        })
    });
    iconFeature.setStyle(iconStyle);
    featuresArr.push(iconFeature);

0 个答案:

没有答案