【问题标题】:How to position a image over the map如何在地图上定位图像
【发布时间】:2020-02-19 04:21:54
【问题描述】:

我试图在地图上定位图像,但无法弄清楚位置值的含义,这让我很难找到图像的正确位置。

以下是我正在使用的代码。

const imageExtent: any = [10, 10, 10, 10];

        this.map = new Map({
            target: 'map',
            interactions: defaultInteractions().extend([new DragRotateAndZoom()]),
            layers: [
                new TileLayer({
                    source: new OSM()
                }),
                new ImageLayer({
                    source: new Static({
                        url: 'https://www.petmd.com/sites/default/files/small-kitten-walking-towards_127900829_0.jpg',
                        crossOrigin: '',
                        projection: 'EPSG:4326',
                        imageExtent
                    })
                })
            ],
            view: new View({
                center: fromLonLat([15, 50]),
                zoom: 16
            })
        });

图片当前正在显示,但位置错误。 我们希望使用与 Google 地图相同的坐标标准。

【问题讨论】:

标签: openlayers openlayers-6


【解决方案1】:

查看ol-ext GeoImage source 以在地图上显示图像。
这个项目可以让你引用图像并计算参数https://github.com/Viglino/Map-georeferencer

【讨论】:

    猜你喜欢
    • 2019-10-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多