forked from iTowns/itowns
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(layer): add full support to scaling for elevation layers
Changing the `scale` property of an `ElevationLayer` can changed the aspect of the visual, allowing exageration of the elevation of the globe, as in the tiff.html example. This is an up-to-date version of iTowns#511
- Loading branch information
Showing
12 changed files
with
118 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"id": "GEOIDMNT", | ||
"noDataValue" : -99999, | ||
"updateStrategy": { | ||
"type": 0 | ||
}, | ||
"source": { | ||
"url": "https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/geoid/geoid/bil/%TILEMATRIX/geoid_%COL_%ROW.bil", | ||
"format": "image/x-bil;bits=32", | ||
"tileMatrixSet": "WGS84G", | ||
"tileMatrixSetLimits": { | ||
"0": { | ||
"minTileRow": 0, | ||
"maxTileRow": 0, | ||
"minTileCol": 0, | ||
"maxTileCol": 1 | ||
}, | ||
"1": { | ||
"minTileRow": 0, | ||
"maxTileRow": 1, | ||
"minTileCol": 0, | ||
"maxTileCol": 3 | ||
}, | ||
"2": { | ||
"minTileRow": 0, | ||
"maxTileRow": 3, | ||
"minTileCol": 0, | ||
"maxTileCol": 7 | ||
}, | ||
"3": { | ||
"minTileRow": 0, | ||
"maxTileRow": 7, | ||
"minTileCol": 0, | ||
"maxTileCol": 15 | ||
}, | ||
"4": { | ||
"minTileRow": 0, | ||
"maxTileRow": 15, | ||
"minTileCol": 0, | ||
"maxTileCol": 31 | ||
} | ||
}, | ||
"zoom": { | ||
"min": 0, | ||
"max": 4 | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
<script src="js/GUI/GuiTools.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/UTIF.js"></script> | ||
<script src="../dist/itowns.js"></script> | ||
<script src="../dist/debug.js"></script> | ||
<script src="js/loading_screen.js"></script> | ||
<script src="js/TIFFParser.js"></script> | ||
<script type="text/javascript"> | ||
|
@@ -47,6 +48,20 @@ | |
}); | ||
|
||
view.addLayer(tiffLayer).then(menuGlobe.addLayerGUI.bind(menuGlobe)); | ||
|
||
function addElevationLayerFromConfig(config) { | ||
config.source = new itowns.TMSSource(config.source); | ||
var layer = new itowns.ElevationLayer(config.id, config); | ||
view.addLayer(layer).then(function _(layer) { | ||
layer.scale = 10000; | ||
view.tileLayer.attachedLayers[0].visible = false; | ||
menuGlobe.addLayerGUI(layer); | ||
}); | ||
} | ||
itowns.Fetcher.json('./layers/JSONLayers/GeoidMNT.json').then(addElevationLayerFromConfig); | ||
|
||
const d = new debug.Debug(view, menuGlobe.gui); | ||
debug.createTileDebugUI(menuGlobe.gui, view, view.tileLayer, d); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters