Class pv.Geo.Projection
Represents a geographic projection. This class provides the core implementation for pv.Geo.scales, mapping between geographic coordinates (latitude and longitude) and normalized screen space in the range [-1,1]. The remaining mapping between normalized screen space and actual pixels is performed by pv.Geo.scale.
Many geographic projections have a point around which the projection is centered. Rather than have each implementation add support for a user-specified center point, the pv.Geo.scale translates the geographic coordinates relative to the center point for both the forward and inverse projection.
In general, this class should not be used directly, unless the desire is
to implement a new geographic projection. Instead, use pv.Geo.scale.
Implementations are not required to implement inverse projections, but are
needed for some forms of interactivity. Also note that some inverse
projections are ambiguous, such as the connecting points in Dymaxian maps.
Defined in: Projection.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Abstract; not implemented.
|
Method Attributes | Method Name and Description |
---|---|
invert(xy)
The inverse projection; optional.
|
|
project(latlng)
The forward projection.
|
- See:
- pv.Geo.scale
- Parameters:
- {pv.Vector} xy
- the x- and y-coordinates to invert.
- Returns:
- {pv.Geo.LatLng} the latitude and longitude of the given point.
- Parameters:
- {pv.Geo.LatLng} latlng
- the latitude and longitude to project.
- Returns:
- {pv.Vector} the xy-coordinates of the given point.