在 Openlayers3 中的图层上拖动、调整图像大小和旋转图像
Dragging, resizing and rotating an image over layers in Openlayers3
我希望能够在 Openlayers3 上在图层 上拖动图像、调整图像大小和旋转图像。图像必须独立于图层。
我尝试将图像渲染为一个层,使用这个:
var extent = map.getView().calculateExtent(map.getSize());
var imageLayer = new ol.layer.Image({opacity: 0.5});
var imageSource = new ol.source.ImageStatic({
url: 'https://dummyimage.com/600x400/faf7fa/0011ff',
imageExtent: extent
});
imageLayer.setSource(imageSource);
map.addLayer(imageLayer);
不幸的是,我没有找到任何关于将图像层拖到其他层上的可能性的线索。
此外,我不想将图像加载为 HTML 元素。我希望它成为 OL canvas.
的一部分
我该如何实现?
我相信 this 之类的内容可以为您指明正确的方向。它没有您想要的那么灵活,但它可以帮助您。
我希望能够在 Openlayers3 上在图层 上拖动图像、调整图像大小和旋转图像。图像必须独立于图层。 我尝试将图像渲染为一个层,使用这个:
var extent = map.getView().calculateExtent(map.getSize());
var imageLayer = new ol.layer.Image({opacity: 0.5});
var imageSource = new ol.source.ImageStatic({
url: 'https://dummyimage.com/600x400/faf7fa/0011ff',
imageExtent: extent
});
imageLayer.setSource(imageSource);
map.addLayer(imageLayer);
不幸的是,我没有找到任何关于将图像层拖到其他层上的可能性的线索。
此外,我不想将图像加载为 HTML 元素。我希望它成为 OL canvas.
的一部分我该如何实现?
我相信 this 之类的内容可以为您指明正确的方向。它没有您想要的那么灵活,但它可以帮助您。