-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #893 from OpenGeoscience/optional-vtkjs
Optional vtkjs
- Loading branch information
Showing
14 changed files
with
5,755 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); |
Oops, something went wrong.