Skip to content

Commit

Permalink
Merge pull request #4 from UniStuttgart-VISUS/release/v0.4.0
Browse files Browse the repository at this point in the history
Release v0.4.0
  • Loading branch information
mfranke93 authored Jan 13, 2023
2 parents 5efe4da + d1f4ccb commit 36b3399
Show file tree
Hide file tree
Showing 6 changed files with 173 additions and 110 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Release Notes
-------------

2023-01-xx v0.4.0

Fixed visibility checks for coordinates in the `Frame` class. Switched
the names of the functions `project` and `unproject` in the `Frame`
class to better align with their respective behavior.


2022-12-29 v0.3.2

First public release with stable API and documentation. Fixed some last
Expand Down
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ To use the library in another project, either build it and use the generated ES
Alternatively, it can be installed as an npm package, either from the command line:

``` bash
$ npm install map-transition-helper@0.3.2
$ npm install map-transition-helper@0.4.0
```

or by adding the following to the `dependencies` property in the `package.json` of your project (with the appropriate version):
Expand All @@ -62,7 +62,7 @@ or by adding the following to the `dependencies` property in the `package.json`
{
...
"dependencies": {
"map-transition-helper": "0.3.2",
"map-transition-helper": "0.4.0",
...
},
...
Expand Down Expand Up @@ -502,13 +502,15 @@ The properties are the same as the parameters of the constructor.

#### <a id="class-frame--methods"></a>Methods

##### `project(coord: Point2D): ViewPoint`
##### <a id="class-frame--project"></a>`project(coord: Coordinate | ViewPoint): Point2D`

Project the canvas pixel coordinate `coord` to the latitude, longitude and zoom level described by the returned `ViewPoint`.
Calculate the pixel coordinates of real-world coordinates.
This is the inverse of [`unproject`](#class-frame--unproject).

##### `unproject(coord: Coordinate | ViewPoint): Point2D`
##### <a id="class-frame--unproject"></a>`unproject(coord: Point2D): ViewPoint`

Calculate the pixel coordinates of real-world coordinates.
Calculate the latitude, longitude and zoom level shown at the pixel coordinate `coord`.
This is the inverse of [`project`](#class-frame--project).

##### `isCoordinateVisible(c: Coordinate): boolean`

Expand Down Expand Up @@ -845,7 +847,7 @@ const transition = await preloadTransition(
// each frame, update the overlay SVG by drawing a dot where Stuttgart is
transition.addEventListener('frame', () => {
const frame = transition.currentFrame;
const { x, y } = frame.unproject(stuttgart);
const { x, y } = frame.project(stuttgart);
svg.innerHTML = `
<circle r="5"
cx="${x}"
Expand Down
Loading

0 comments on commit 36b3399

Please sign in to comment.