Skip to content

Commit

Permalink
Merge pull request #893 from OpenGeoscience/optional-vtkjs
Browse files Browse the repository at this point in the history
Optional vtkjs
  • Loading branch information
manthey authored Nov 2, 2018
2 parents cca6ef5 + 154bb5f commit 0ba82ff
Show file tree
Hide file tree
Showing 14 changed files with 5,755 additions and 209 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

### Features
- Feature selection API is now enabled automatically if any event handlers are bounds to the feature (#921)
- Added a VTK.js renderer which supports a point feature (#893)

### Improvements
- Coordinate transforms on flat arrays are now faster (#939)
- `convertColor` is memoized to speed up repeated calls (#936)
- All features have a `featureType` property (#931)
- When changing geometry sizes, buffers are reallocated less (#941)
- Initial rendering webGL features is somewhat faster (#943)

### Changes
- Removed the dependency on the vgl module for the `object` and `timestamp` classes (#918)
Expand Down
8 changes: 8 additions & 0 deletions examples/vtkjs/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"title": "Use VTK.js along with GeoJS",
"exampleJs": ["main.js"],
"about": {
"text": "Show national capitals as points using the vtkjs renderer."
},
"disabled": true
}
23 changes: 23 additions & 0 deletions examples/vtkjs/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Fetch the dataset from the server
$.ajax({url: '../reprojection/capitals.json'}).done(function (capitals) {
// Create a map
var map = geo.map({node: '#map'});
// Add the map tile layer
map.createLayer('osm');
// Create a vtk point feature layer
var vtkLayer = map.createLayer('feature', {renderer: 'vtkjs'});
vtkLayer.createFeature('point', {
selectionAPI: true,
style: {
radius: 5,
fillColor: 'red',
fillOpacity: 1
}
})
// Bind the dataset to the vtk layer
.data(capitals)
.position(function (d) {
return {x: d.longitude, y: d.latitude}; // position accessor
})
.draw();
});
Loading

0 comments on commit 0ba82ff

Please sign in to comment.