diff --git a/examples/cubic_planar.html b/examples/cubic_planar.html index 5a0d72db86..6be4008fbd 100644 --- a/examples/cubic_planar.html +++ b/examples/cubic_planar.html @@ -30,6 +30,7 @@ var obj; var offset; var tileLayer; + var config; var wmsLayers = [ 'fpc_fond_plan_communaut.fpcilot', @@ -108,42 +109,49 @@ parent.add(obj); obj.updateMatrixWorld(true); - tileLayer = itowns.createPlanarLayer('planar' + wms + index, extent, { object3d: obj }); - tileLayer.disableSkirt = true; + config = { + object3d: obj, + // Since the elevation layer use color textures, specify min/max z + materialOptions: { + useColorTextureElevation: true, + colorTextureElevationMinZ: -600, + colorTextureElevationMaxZ: 400, + }, + disableSkirt: true, + }; + + tileLayer = itowns.createPlanarLayer('planar' + wms + index, extent, config); view.addLayer(tileLayer); view.addLayer({ - url: 'https://download.data.grandlyon.com/wms/grandlyon', - networkOptions: { crossOrigin: 'anonymous' }, type: 'color', - protocol: 'wms', - version: '1.3.0', id: 'wms_imagery' + wms + index, - name: wms, - projection: 'EPSG:3946', - format: 'image/jpeg', + source: { + protocol: 'wms', + url: 'https://download.data.grandlyon.com/wms/grandlyon', + version: '1.3.0', + name: wms, + projection: 'EPSG:3946', + format: 'image/jpeg', + extent, + }, }, tileLayer); view.addLayer({ - url: 'https://download.data.grandlyon.com/wms/grandlyon', - type: 'elevation', - protocol: 'wms', - networkOptions: { crossOrigin: 'anonymous' }, - version: '1.3.0', id: 'wms_elevation' + wms + index, - name: 'MNT2012_Altitude_10m_CC46', - projection: 'EPSG:3946', - heightMapWidth: 256, - format: 'image/jpeg', + type: 'elevation', + source: { + protocol: 'wms', + extent, + version: '1.3.0', + name: 'MNT2012_Altitude_10m_CC46', + projection: 'EPSG:3946', + heightMapWidth: 256, + format: 'image/jpeg', + url: 'https://download.data.grandlyon.com/wms/grandlyon', + }, }, tileLayer); - - // Since the elevation layer use color textures, specify min/max z - tileLayer.materialOptions = { - useColorTextureElevation: true, - colorTextureElevationMinZ: -600, - colorTextureElevationMaxZ: 400, - }; } // Since PlanarView doesn't create default controls, we manipulate directly three.js camera diff --git a/examples/globe_geojson_to3D.html b/examples/globe_geojson_to3D.html new file mode 100644 index 0000000000..dc9b4daa1f --- /dev/null +++ b/examples/globe_geojson_to3D.html @@ -0,0 +1,80 @@ + +
+Information Batiment
+diff --git a/examples/globe_vector_tiles.html b/examples/globe_vector_tiles.html index 4282206fa0..d76e99c950 100644 --- a/examples/globe_vector_tiles.html +++ b/examples/globe_vector_tiles.html @@ -33,6 +33,8 @@ // define pole texture view.wgs84TileLayer.noTextureColor = new itowns.THREE.Color(0x95c1e1); + view.atmosphere.visible = false; + setupLoadingScreen(viewerDiv, view); function addLayerCb(layer) { return view.addLayer(layer); @@ -40,8 +42,9 @@ // Add two elevation layers. // These will deform iTowns globe geometry to represent terrain elevation. - promises.push(itowns.Fetcher.json('./layers/JSONLayers/WORLD_DTM.json').then(addLayerCb)); - promises.push(itowns.Fetcher.json('./layers/JSONLayers/IGN_MNT_HIGHRES.json').then(addLayerCb)); + // promises.push(itowns.Fetcher.json('./layers/JSONLayers/Ortho.json').then(addLayerCb)); + // promises.push(itowns.Fetcher.json('./layers/JSONLayers/WORLD_DTM.json').then(addLayerCb)); + // promises.push(itowns.Fetcher.json('./layers/JSONLayers/IGN_MNT_HIGHRES.json').then(addLayerCb)); // Add a vector tile layer itowns.Fetcher.json('https://raw.githubusercontent.com/Oslandia/postile-openmaptiles/master/style.json').then(function (style) { @@ -56,14 +59,21 @@ } }); + function isValidData(data, extentDestination) { + return extentDestination.zoom - data.extent.zoom < 4; + } + promises.push(view.addLayer({ type: 'color', - protocol: 'xyz', id: 'MVT', - // eslint-disable-next-line no-template-curly-in-string - url: 'https://osm.oslandia.io/data/v3/${z}/${x}/${y}.pbf', - format: 'application/x-protobuf;type=mapbox-vector', - options: { + isValidData: isValidData, + source: { + protocol: 'xyz', + // eslint-disable-next-line no-template-curly-in-string + url: 'https://osm.oslandia.io/data/v3/${z}/${x}/${y}.pbf', + format: 'application/x-protobuf;type=mapbox-vector', + projection: 'EPSG:4326', + origin: 'top', attribution: { name: 'OpenStreetMap', url: 'http://www.openstreetmap.org/', @@ -72,10 +82,7 @@ min: 2, max: 14, }, - opacity: 0.5, - }, - updateStrategy: { - type: itowns.STRATEGY_DICHOTOMY, + tileMatrixSet: 'PM', }, style: mapboxStyle, filter: mapboxFilter(supportedLayers), @@ -89,6 +96,7 @@ Promise.all(promises).then(function () { menuGlobe.addImageryLayersGUI(view.getLayers(function (l) { return l.type === 'color'; })); menuGlobe.addElevationLayersGUI(view.getLayers(function (l) { return l.type === 'elevation'; })); + // itowns.ColorLayersOrdering.moveLayerToIndex(view, 'Ortho', 0); }).catch(console.error); }); diff --git a/examples/globe_wfs_color.html b/examples/globe_wfs_color.html new file mode 100644 index 0000000000..3c4738638b --- /dev/null +++ b/examples/globe_wfs_color.html @@ -0,0 +1,96 @@ + +
+
+ + + + + + + + +
+