From 25b0cce8ed16cb5275aa50116f121855b0181235 Mon Sep 17 00:00:00 2001 From: mike-000 <49240900+mike-000@users.noreply.github.com> Date: Thu, 16 Apr 2020 22:13:12 +0100 Subject: [PATCH] fix prettier --- examples/geojson-vt.js | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/examples/geojson-vt.js b/examples/geojson-vt.js index b8d2f5c12e..50adc4ac7c 100644 --- a/examples/geojson-vt.js +++ b/examples/geojson-vt.js @@ -89,27 +89,21 @@ fetch(url) // For tile loading obtain the GeoJSON for the tile coordinate // before calling the default tileLoadFunction const defaultTileLoadFunction = vectorSource.getTileLoadFunction(); - vectorSource.setTileLoadFunction( - function (tile, url) { - const tileCoord = JSON.parse(url); - const data = tileIndex.getTile( - tileCoord[0], - tileCoord[1], - tileCoord[2] - ); - const geojson = JSON.stringify( - { - type: 'FeatureCollection', - features: data ? data.features : [], - }, - replacer - ); - defaultTileLoadFunction( - tile, - 'data:application/json;charset=UTF-8,' + geojson - ); - } - ); + vectorSource.setTileLoadFunction(function (tile, url) { + const tileCoord = JSON.parse(url); + const·data·=·tileIndex.getTile(tileCoord[0],·tileCoord[1],·tileCoord[2]); + const geojson = JSON.stringify( + { + type: 'FeatureCollection', + features: data ? data.features : [], + }, + replacer + ); + defaultTileLoadFunction( + tile, + 'data:application/json;charset=UTF-8,' + geojson + ); + }); const vectorLayer = new VectorTileLayer({ source: vectorSource, });