Skip to content

Commit

Permalink
#42 Change ito avoid using a mapboxgl.Point
Browse files Browse the repository at this point in the history
  • Loading branch information
jscastro76 committed Nov 8, 2020
1 parent c433aa4 commit 0d8ba60
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Minor version by [@jscastro76](https://github.com/jscastro76), some enhancements

#### :beetle: Bug fixes

- [**#42**](https://github.com/jscastro76/threebox/issues/77) Angular and Threebox. Solved an issue using a `mapboxgl.Point`line
- [**#77**](https://github.com/jscastro76/threebox/issues/77) example 05-logistics raises an error removing the line
- [**#79**](https://github.com/jscastro76/threebox/issues/79) Some examples are not using `renderingMode: 3d` in the layer creation

Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ A **[*Three.js*](https://threejs.org/)** plugin for **[*Mapbox GL JS*](https://d

Current release is [**2.0.7**](https://github.com/jscastro76/threebox/releases/tag/v.2.0.7), please review the [**Change log**](https://github.com/jscastro76/threebox/blob/master/CHANGELOG.md#207) for more details.

Threebox is available as an [nmp package](https://www.npmjs.com/package/threebox-plugin)
```js
npm i threebox-plugin
```
<br>

- - -
Expand Down Expand Up @@ -93,7 +97,7 @@ All the [**Threebox Documentation**](/docs/Threebox.md) has been completely upda
You can use threebox in two different ways.

#### NPM install
Add threebox to your project via npm:
Add threebox to your project via [npm package](https://www.npmjs.com/package/threebox-plugin):

`npm install threebox-plugin`

Expand Down
10 changes: 5 additions & 5 deletions dist/threebox.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ Threebox.prototype = {
// Return the xy coordinates of the mouse position
function mousePos(e) {
var rect = canvas.getBoundingClientRect();
return new mapboxgl.Point(
e.originalEvent.clientX - rect.left - canvas.clientLeft,
e.originalEvent.clientY - rect.top - canvas.clientTop
);
return {
x: e.originalEvent.clientX - rect.left - canvas.clientLeft,
y: e.originalEvent.clientY - rect.top - canvas.clientTop
};
}

function unselectFeature(f, map) {
Expand Down Expand Up @@ -879,7 +879,7 @@ Threebox.prototype = {

programs: function () { return this.renderer.info.programs.length },

version: '2.0.7',
version: '2.0.8',

}

Expand Down
2 changes: 1 addition & 1 deletion dist/threebox.min.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/Threebox.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ Threebox.prototype = {
// Return the xy coordinates of the mouse position
function mousePos(e) {
var rect = canvas.getBoundingClientRect();
return new mapboxgl.Point(
e.originalEvent.clientX - rect.left - canvas.clientLeft,
e.originalEvent.clientY - rect.top - canvas.clientTop
);
return {
x: e.originalEvent.clientX - rect.left - canvas.clientLeft,
y: e.originalEvent.clientY - rect.top - canvas.clientTop
};
}

function unselectFeature(f, map) {
Expand Down Expand Up @@ -874,7 +874,7 @@ Threebox.prototype = {

programs: function () { return this.renderer.info.programs.length },

version: '2.0.7',
version: '2.0.8',

}

Expand Down
10 changes: 5 additions & 5 deletions tests/threebox-tests-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -9084,10 +9084,10 @@ Threebox.prototype = {
// Return the xy coordinates of the mouse position
function mousePos(e) {
var rect = canvas.getBoundingClientRect();
return new mapboxgl.Point(
e.originalEvent.clientX - rect.left - canvas.clientLeft,
e.originalEvent.clientY - rect.top - canvas.clientTop
);
return {
x: e.originalEvent.clientX - rect.left - canvas.clientLeft,
y: e.originalEvent.clientY - rect.top - canvas.clientTop
};
}

function unselectFeature(f, map) {
Expand Down Expand Up @@ -9818,7 +9818,7 @@ Threebox.prototype = {

programs: function () { return this.renderer.info.programs.length },

version: '2.0.7',
version: '2.0.8',

}

Expand Down

0 comments on commit 0d8ba60

Please sign in to comment.