Skip to content

Commit

Permalink
fix(examples): replace deprecated parsedData by features.
Browse files Browse the repository at this point in the history
  • Loading branch information
gchoqueux committed Oct 1, 2020
1 parent 096e678 commit 92d9ca0
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 23 deletions.
4 changes: 2 additions & 2 deletions examples/js/plugins/CSVnVRTParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
* buildExtent: true,
* crsOut: 'EPSG:4326'
* });
* }).then(function _(feature) {
* var source = new itowns.FileSource({ parsedData: feature });
* }).then(function _(features) {
* var source = new itowns.FileSource({ features });
* var layer = new itowns.ColorLayer('CSVnVRT', { source });
* view.addLayer(layer);
* });
Expand Down
8 changes: 4 additions & 4 deletions examples/js/plugins/DragNDrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ var DragNDrop = (function _() {
mergeFeatures: true,
withNormal: (extension.mode == _GEOMETRY),
withAltitude: (extension.mode == _GEOMETRY),
}).then(function _(result) {
var dimensions = result.extent.dimensions();
}).then(function _(features) {
var dimensions = features.extent.dimensions();

var source = new itowns.FileSource({
parsedData: result,
features: features,
crs: 'EPSG:4326',
});

Expand Down Expand Up @@ -119,7 +119,7 @@ var DragNDrop = (function _() {

// Move the camera to the first vertex
itowns.CameraUtils.animateCameraToLookAtTarget(_view, _view.camera.camera3D, {
coord: new itowns.Coordinates(result.crs, result.features[0].vertices),
coord: new itowns.Coordinates(features.crs, features.features[0].vertices),
range: dimensions.x * dimensions.y * 1e6,
});
});
Expand Down
2 changes: 1 addition & 1 deletion examples/js/plugins/TIFFParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Fetcher.arrayBuffer('image.tiff')
* .then(TIFFParser.parse)
* .then(function _(texture) {
* var source = new itowns.FileSource({ parsedData: texture });
* var source = new itowns.FileSource({ features: texture });
* var layer = new itowns.ColorLayer('tiff', { source });
* view.addLayer(layer);
* });
Expand Down
6 changes: 2 additions & 4 deletions examples/plugins_vrt.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,8 @@
buildExtent: true,
crsOut: view.tileLayer.extent.crs,
});
}).then(function _(feature) {
var velibSource = new itowns.FileSource({
parsedData: feature,
});
}).then(function _(features) {
var velibSource = new itowns.FileSource({ features });

var velibLayer = new itowns.ColorLayer('velib', {
source: velibSource,
Expand Down
12 changes: 4 additions & 8 deletions examples/source_file_geojson_raster.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,8 @@
itowns.Fetcher.json('https://raw.githubusercontent.com/gregoiredavid/france-geojson/master/departements/09-ariege/departement-09-ariege.geojson')
.then(function _(geojson) {
return itowns.GeoJsonParser.parse(geojson, optionsGeoJsonParser);
}).then(function _(parsedData) {
var ariegeSource = new itowns.FileSource({
parsedData,
});
}).then(function _(features) {
var ariegeSource = new itowns.FileSource({ features });

var ariegeStyle = new itowns.Style({
fill: {
Expand All @@ -97,10 +95,8 @@
itowns.Fetcher.json('https://raw.githubusercontent.com/gregoiredavid/france-geojson/master/departements/66-pyrenees-orientales/departement-66-pyrenees-orientales.geojson')
.then(function _(geojson) {
return itowns.GeoJsonParser.parse(geojson, optionsGeoJsonParser);
}).then(function _(parsedData) {
var pyoSource = new itowns.FileSource({
parsedData,
});
}).then(function _(features) {
var pyoSource = new itowns.FileSource({ features });

var pyoStyle = new itowns.Style({
fill: {
Expand Down
6 changes: 2 additions & 4 deletions examples/source_file_shapefile.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,8 @@
buildExtent: true,
crsOut: view.tileLayer.extent.crs,
});
}).then(function _(feature) {
var velibSource = new itowns.FileSource({
parsedData: feature,
});
}).then(function _(features) {
var velibSource = new itowns.FileSource({ features });

var velibStyle = new itowns.Style({
zoom: { min: 10, max: 20 },
Expand Down

0 comments on commit 92d9ca0

Please sign in to comment.