因为Google Earth不推荐使用他们的插件,所以我需要旋转一个覆盖在平铺的OpenLayers 3.0层上的图像,但我看不到有任何方法可以做到这一点。
我在地图上分层绘制历史地图,并不是所有的地图都朝北。
有什么想法吗?
发布于 2015-02-26 01:57:39
你找到解决方案了吗?
我正面临着同样的问题,但我还没有尝试过,但据我所知,如果我们定义一个样式函数来保持方向和缩放,那么具有点特征的向量层就可以做到这一点。
Make marker zoom/rotate with map in Openlayers 3
vectorLayer.setStyle(function(feature, resolution) {
var maxResolution = 10000;
var styleArray = [ new ol.style.Style( {
image: new ol.style.Icon({
src: 'http://your.path.to/the/image.png',
scale: maxResolution/resolution,
rotateWithView: true,
rotation: .5,
anchor: [.5,.5],
anchorXUnits: 'fraction', anchorYUnits: 'fraction',
opacity: 0.75
})
})];
return styleArray;
});https://stackoverflow.com/questions/26834315
复制相似问题