|
29 | 29 | var parent;
|
30 | 30 | var index;
|
31 | 31 | var wms;
|
| 32 | + var wmsUrl; |
32 | 33 | var obj;
|
33 | 34 | var offset;
|
34 | 35 | var tileLayer;
|
35 | 36 | var config;
|
36 | 37 |
|
37 |
| - var wmsLayers = [ |
38 |
| - 'fpc_fond_plan_communaut.fpcilot', |
39 |
| - 'pvo_patrimoine_voirie.pvochausseetrottoir', |
40 |
| - 'Ortho2009_vue_ensemble_16cm_CC46', |
41 |
| - 'pos_opposable.poshauvoi', |
42 |
| - 'MNT2015_Ombrage_2m', |
43 |
| - 'cad_cadastre.cadilot', |
| 38 | + var wmsSources = [ |
| 39 | + { |
| 40 | + name: 'fpc_fond_plan_communaut.fpcilot', |
| 41 | + url: 'https://download.data.grandlyon.com/wms/grandlyon', |
| 42 | + }, |
| 43 | + { |
| 44 | + name: 'pvo_patrimoine_voirie.pvochausseetrottoir', |
| 45 | + url: 'https://download.data.grandlyon.com/wms/grandlyon', |
| 46 | + }, |
| 47 | + { |
| 48 | + name: 'ortho_latest', |
| 49 | + url: 'https://imagerie.data.grandlyon.com/wms/grandlyon', |
| 50 | + }, |
| 51 | + { |
| 52 | + name: 'pos_opposable.poshauvoi', |
| 53 | + url: 'https://download.data.grandlyon.com/wms/grandlyon', |
| 54 | + }, |
| 55 | + { |
| 56 | + name: 'MNT2015_Ombrage_2m', |
| 57 | + url: 'https://download.data.grandlyon.com/wms/grandlyon', |
| 58 | + }, |
| 59 | + { |
| 60 | + name: 'cad_cadastre.cadilot', |
| 61 | + url: 'https://download.data.grandlyon.com/wms/grandlyon', |
| 62 | + }, |
44 | 63 | ];
|
45 | 64 |
|
46 | 65 | var cubeTransformations = [
|
|
106 | 125 | url: 'https://download.data.grandlyon.com/wms/grandlyon',
|
107 | 126 | });
|
108 | 127 |
|
109 |
| - for (index = 0; index < wmsLayers.length; index++) { |
110 |
| - wms = wmsLayers[index]; |
| 128 | + for (index = 0; index < wmsSources.length; index++) { |
| 129 | + wms = wmsSources[index]; |
111 | 130 | obj = new itowns.THREE.Object3D();
|
112 | 131 | offset = extent.center().toVector3().negate().applyEuler(cubeTransformations[index].rotation);
|
113 | 132 | offset.add(cubeTransformations[index].position.divide(scale));
|
|
116 | 135 | parent.add(obj);
|
117 | 136 | obj.updateMatrixWorld(true);
|
118 | 137 |
|
119 |
| - tileLayer = new itowns.PlanarLayer('planar' + wms + index, |
| 138 | + tileLayer = new itowns.PlanarLayer('planar' + wms.name + index, |
120 | 139 | extent, obj, { disableSkirt: true });
|
121 | 140 |
|
122 | 141 | view.addLayer(tileLayer);
|
123 | 142 |
|
124 | 143 | var colorSource = new itowns.WMSSource({
|
125 |
| - url: 'https://download.data.grandlyon.com/wms/grandlyon', |
| 144 | + url: wms.url, |
126 | 145 | version: '1.3.0',
|
127 |
| - name: wms, |
| 146 | + name: wms.name, |
128 | 147 | crs: 'EPSG:3946',
|
129 | 148 | format: 'image/jpeg',
|
130 | 149 | extent,
|
131 | 150 | });
|
132 |
| - var colorLayer = new itowns.ColorLayer('wms_imagery' + wms + index, { |
| 151 | + var colorLayer = new itowns.ColorLayer('wms_imagery' + wms.name + index, { |
133 | 152 | source: colorSource,
|
134 | 153 | });
|
135 | 154 | view.addLayer(colorLayer, tileLayer);
|
136 |
| - var elevationLayer = new itowns.ElevationLayer('wms_elevation' + wms + index, { |
| 155 | + var elevationLayer = new itowns.ElevationLayer('wms_elevation' + wms.name + index, { |
137 | 156 | source: elevationSource,
|
138 | 157 | useColorTextureElevation: true,
|
139 | 158 | colorTextureElevationMinZ: 144,
|
|
0 commit comments