Skip to content

Commit

Permalink
fix(examples): Replace Lyon's deprecated Ortho2009 sources
Browse files Browse the repository at this point in the history
  • Loading branch information
Desplandis authored and jailln committed Jul 26, 2023
1 parent 2fbbcc3 commit 8dbb3d6
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 27 deletions.
4 changes: 2 additions & 2 deletions examples/3dtiles_25d.html
Expand Up @@ -38,8 +38,8 @@
// Add a WMS imagery source
var wmsImagerySource = new itowns.WMSSource({
extent: extent,
name: 'Ortho2009_vue_ensemble_16cm_CC46',
url: 'https://download.data.grandlyon.com/wms/grandlyon',
name: 'ortho_latest',
url: 'https://imagerie.data.grandlyon.com/wms/grandlyon',
version: '1.3.0',
crs: 'EPSG:3946',
format: 'image/jpeg',
Expand Down
4 changes: 2 additions & 2 deletions examples/misc_compare_25d_3d.html
Expand Up @@ -134,8 +134,8 @@

var wmsImagerySource = new itowns.WMSSource({
extent: extent,
name: 'Ortho2009_vue_ensemble_16cm_CC46',
url: 'https://download.data.grandlyon.com/wms/grandlyon',
name: 'ortho_latest',
url: 'https://imagerie.data.grandlyon.com/wms/grandlyon',
version: '1.3.0',
crs: 'EPSG:3946',
format: 'image/jpeg',
Expand Down
4 changes: 2 additions & 2 deletions examples/misc_orthographic_camera.html
Expand Up @@ -62,8 +62,8 @@
// add a WMS imagery source
const wmsImagerySource = new itowns.WMSSource({
extent: extent,
name: 'Ortho2009_vue_ensemble_16cm_CC46',
url: 'https://download.data.grandlyon.com/wms/grandlyon',
name: 'ortho_latest',
url: 'https://imagerie.data.grandlyon.com/wms/grandlyon',
version: '1.3.0',
crs: 'EPSG:3946',
format: 'image/jpeg',
Expand Down
4 changes: 2 additions & 2 deletions examples/source_stream_wfs_25d.html
Expand Up @@ -64,10 +64,10 @@
setupLoadingScreen(viewerDiv, view);

wmsImagerySource = new itowns.WMSSource({
url: 'https://download.data.grandlyon.com/wms/grandlyon',
url: 'https://imagerie.data.grandlyon.com/wms/grandlyon',
networkOptions: { crossOrigin: 'anonymous' },
version: '1.3.0',
name: 'Ortho2009_vue_ensemble_16cm_CC46',
name: 'ortho_latest',
crs: 'EPSG:3946',
extent: extent,
format: 'image/jpeg',
Expand Down
4 changes: 2 additions & 2 deletions examples/view_25d_map.html
Expand Up @@ -59,8 +59,8 @@
// Add a WMS imagery source
var wmsImagerySource = new itowns.WMSSource({
extent: extent,
name: 'Ortho2009_vue_ensemble_16cm_CC46',
url: 'https://download.data.grandlyon.com/wms/grandlyon',
name: 'ortho_latest',
url: 'https://imagerie.data.grandlyon.com/wms/grandlyon',
version: '1.3.0',
crs: 'EPSG:3946',
format: 'image/jpeg',
Expand Down
47 changes: 33 additions & 14 deletions examples/view_multi_25d.html
Expand Up @@ -29,18 +29,37 @@
var parent;
var index;
var wms;
var wmsUrl;
var obj;
var offset;
var tileLayer;
var config;

var wmsLayers = [
'fpc_fond_plan_communaut.fpcilot',
'pvo_patrimoine_voirie.pvochausseetrottoir',
'Ortho2009_vue_ensemble_16cm_CC46',
'pos_opposable.poshauvoi',
'MNT2015_Ombrage_2m',
'cad_cadastre.cadilot',
var wmsSources = [
{
name: 'fpc_fond_plan_communaut.fpcilot',
url: 'https://download.data.grandlyon.com/wms/grandlyon',
},
{
name: 'pvo_patrimoine_voirie.pvochausseetrottoir',
url: 'https://download.data.grandlyon.com/wms/grandlyon',
},
{
name: 'ortho_latest',
url: 'https://imagerie.data.grandlyon.com/wms/grandlyon',
},
{
name: 'pos_opposable.poshauvoi',
url: 'https://download.data.grandlyon.com/wms/grandlyon',
},
{
name: 'MNT2015_Ombrage_2m',
url: 'https://download.data.grandlyon.com/wms/grandlyon',
},
{
name: 'cad_cadastre.cadilot',
url: 'https://download.data.grandlyon.com/wms/grandlyon',
},
];

var cubeTransformations = [
Expand Down Expand Up @@ -106,8 +125,8 @@
url: 'https://download.data.grandlyon.com/wms/grandlyon',
});

for (index = 0; index < wmsLayers.length; index++) {
wms = wmsLayers[index];
for (index = 0; index < wmsSources.length; index++) {
wms = wmsSources[index];
obj = new itowns.THREE.Object3D();
offset = extent.center().toVector3().negate().applyEuler(cubeTransformations[index].rotation);
offset.add(cubeTransformations[index].position.divide(scale));
Expand All @@ -116,24 +135,24 @@
parent.add(obj);
obj.updateMatrixWorld(true);

tileLayer = new itowns.PlanarLayer('planar' + wms + index,
tileLayer = new itowns.PlanarLayer('planar' + wms.name + index,
extent, obj, { disableSkirt: true });

view.addLayer(tileLayer);

var colorSource = new itowns.WMSSource({
url: 'https://download.data.grandlyon.com/wms/grandlyon',
url: wms.url,
version: '1.3.0',
name: wms,
name: wms.name,
crs: 'EPSG:3946',
format: 'image/jpeg',
extent,
});
var colorLayer = new itowns.ColorLayer('wms_imagery' + wms + index, {
var colorLayer = new itowns.ColorLayer('wms_imagery' + wms.name + index, {
source: colorSource,
});
view.addLayer(colorLayer, tileLayer);
var elevationLayer = new itowns.ElevationLayer('wms_elevation' + wms + index, {
var elevationLayer = new itowns.ElevationLayer('wms_elevation' + wms.name + index, {
source: elevationSource,
useColorTextureElevation: true,
colorTextureElevationMinZ: 144,
Expand Down
6 changes: 3 additions & 3 deletions examples/widgets_3dtiles_style.html
Expand Up @@ -39,8 +39,8 @@
// Add a WMS imagery source
const wmsImagerySource = new itowns.WMSSource({
extent: extent,
name: 'Ortho2009_vue_ensemble_16cm_CC46',
url: 'https://download.data.grandlyon.com/wms/grandlyon',
name: 'ortho_latest',
url: 'https://imagerie.data.grandlyon.com/wms/grandlyon',
version: '1.3.0',
crs: 'EPSG:3946',
format: 'image/jpeg',
Expand Down Expand Up @@ -110,7 +110,7 @@
view.domElement.onclick = (event) => {
const intersects = view.pickObjectsAt(event, 0, [$3dTilesLayer]);
const c3DTileFeatureClicked = $3dTilesLayer.getC3DTileFeatureFromIntersectsArray(intersects);

if (c3DTileFeatureClicked) {
const worldBox3 = $3dTilesLayer.computeWorldBox3(c3DTileFeatureClicked);
cube.scale.copy(worldBox3.max.clone().sub(worldBox3.min));
Expand Down

0 comments on commit 8dbb3d6

Please sign in to comment.