Skip to content

Vertical/azimuthal perspective? #264

@ejschoen

Description

@ejschoen

Not sure where the right place to ask this is. SInce the ol-maplibre-layer exists at the intersecton of MapLibre and OpenLayers, I thought I would start here.

MapLibre GL JS can now render tile data with vertical/azimuthal perspective by setting the projection type to vertical-perspective or can interpolate between web mercator and vertical perspective by setting the projection type to "globe."

proj4 can handle orthographic projections:

+proj=ortho +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +a=6370997 +b=6370997 +units=m +no_defs 

Rendering a vector layer atop a MapLibre map almost works with the OpenLayers view projection set to the above proj4 definition. Well, only if the camera is positioned above long,lat=0,0:

Image

It doesn't work elsewhere:

Image

I realize the proj4 definition above might have the wrong parameters, but looking at MapLibre's source code, the vertical perspective transform code looks pretty complicated (cf: clipping logic at the limb of the globe) and may not be as simple as can be handled by a proj4 transform. Has anyone explored whether there is a view perspective that can work with OpenLayers to render vector data in a matching vertical perspective?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions