Skip to content

Commit

Permalink
- three.js draw geojson #125
Browse files Browse the repository at this point in the history
- add options.rotate and options.scale for Objects3D #126
- Create a new example with Three.js extrusions based on standard geoJson #127 Added a new example [17-extrusions.html](https://github.com/jscastro76/threebox/blob/master/examples/17-extrusions.html)
- Convert internal variables (`selectedObject`, `draggedObject`, ...) into instance variables #130
- Deprecate `tb.setLayerZoomVisibility`, overlaps with `tb.toggleLayer` #134
- when an object is wireframed, all its clones are too #124
- Error when wireframing all the objects #131
- While dragging an object if mouse overs a label it stops dragging #132
- A layer shouldn't be shown explicitely if it's not in the right zoom range #133
  • Loading branch information
jscastro76 committed Dec 6, 2020
1 parent c90e38e commit af6b29d
Show file tree
Hide file tree
Showing 8 changed files with 469 additions and 444 deletions.
13 changes: 10 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ Minor version by [@jscastro76](https://github.com/jscastro76), some enhancements

#### :sparkles: Enhancements

- [**#127**](https://github.com/jscastro76/threebox/issues/127) Create a new example with Three.js extrusions based on standard geoJson #127 Added a new example [17-extrusions.html](https://github.com/jscastro76/threebox/blob/master/examples/17-extrusions.html)
- [**#126**](https://github.com/jscastro76/threebox/issues/126) add options.rotate and options.scale for Objects3D #126
- [**#125**](https://github.com/jscastro76/threebox/issues/125) three.js draw geojson #125
- three.js draw geojson #125
- add options.rotate and options.scale for Objects3D #126
- Create a new example with Three.js extrusions based on standard geoJson #127 Added a new example [17-extrusions.html](https://github.com/jscastro76/threebox/blob/master/examples/17-extrusions.html)
- Convert internal variables (`selectedObject`, `draggedObject`, ...) into instance variables #130
- Deprecate `tb.setLayerZoomVisibility`, overlaps with `tb.toggleLayer` #134

#### :beetle: Bug fixes

- when an object is wireframed, all its clones are too #124
- Error when wireframing all the objects #131
- While dragging an object if mouse overs a label it stops dragging #132
- A layer shouldn't be shown explicitely if it's not in the right zoom range #133

<br>

- - -
Expand Down
292 changes: 148 additions & 144 deletions dist/threebox.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/threebox.min.js

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions examples/18-extrusions.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@

mapboxgl.accessToken = config.accessToken;

let origin1 = [-73.9999607205391, 40.71489610465261, 0];
let origin2 = [-73.9999607205391, 40.71489610465261, 50]
let origin1 = [-74.001058, 40.714914, 0];
let origin2 = [-74.0001269, 40.7151698, 50]

let map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/outdoors-v11',
center: origin1,
zoom: 16.5,
zoom: 16.9,
pitch: 60,
heading: 0, hash: true
});
Expand Down Expand Up @@ -82,12 +82,14 @@
let star = tb.extrusion({
coordinates: points,
geometryOptions: { depth: 20, steps: 1, bevelEnabled: true, bevelThickness: 2, bevelSize: 4, bevelSegments: 1 },
anchor: 'top-right',
anchor: 'center',
units: 'meters',
rotation: { x: 90, y: 0, z: 20 },
materials: [material1, material2]
});
star.addTooltip("A animated extruded star over Columbus Park", true);
star.setCoords(origin2);
star.set({ rotation: {x: 0, y: 0, z: 720}, duration: 10000 })
tb.add(star);

//[jscastro] we read a geoJson that is filled with 3 real features from the composite source
Expand Down Expand Up @@ -118,6 +120,7 @@
geometryOptions: { curveSegments: 1, bevelEnabled: false, depth: b.layer.paint["fill-extrusion-height"] * s },
materials: redMaterial
});
extrusion.addTooltip(b.properties.tooltip, true);
extrusion.setCoords([center[0], center[1], 0]);
tb.add(extrusion);

Expand Down
9 changes: 6 additions & 3 deletions examples/geojson/extrusion.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
"min_height": 0,
"iso_3166_2": "US-NY",
"uuid": "802C4B41-D2F4-4A51-B2F7-18894CF2C6FE",
"center": [ -74.001234, 40.715092 ]
"center": [ -74.001234, 40.715092 ],
"tooltip": "The Louis J. Lefkowitz - State Office Building"
},
"id": 3359447,
"layer": {
Expand Down Expand Up @@ -247,7 +248,8 @@
"min_height": 0,
"iso_3166_2": "US-NY",
"uuid": "82594BCA-C3AD-4440-84A4-8EE82BA3073D",
"center": [ -74.00157, 40.714276 ]
"center": [ -74.00157, 40.714276 ],
"tooltip": "New York Supreme Court"
},
"id": 3696430,
"layer": {
Expand Down Expand Up @@ -386,7 +388,8 @@
"min_height": 0,
"iso_3166_2": "US-NY",
"uuid": "170894F0-BA9C-43AE-AFC5-45C669DDA0DD",
"center": [ -74.002338, 40.713651 ]
"center": [ -74.002338, 40.713651 ],
"tooltip": "Thurgood Marshall United States Courthouse"
},
"id": 3696564,
"layer": {
Expand Down
Loading

0 comments on commit af6b29d

Please sign in to comment.