Attention ! Gitlab fournissant maintenant nativement des certificats Let’s Encrypt aux domaines personnalisés des Gitlab Pages, nous avons coupé notre service qui le faisait automatiquement pour vous.

Il est impératif, pour que votre domaine personnalisé continue à avoir un certificat Let’s Encrypt à jour, d’activer la fonctionnalité native dans les paramètres de votre projet. Cette activation remplacera votre certificat actuel par un nouveau certificat Let’s Encrypt géré par Gitlab.

Voir les détails sur https://docs.framasoft.org/fr/gitlab/gitlab-pages-le.html

Commit 582a4077 authored by Clément Igonet's avatar Clément Igonet

viewer-earth-api - Use of "factor" parameter to load only zomm 16 tiles on server.

parent de42ec83
......@@ -41,7 +41,8 @@
margin-right: 5%;
}
</style>
<script src="bower_components/three.js/three.min.js"></script>
<!-- <script src="bower_components/three.js/three.min.js"></script> -->
<script src="node_modules/three/build/three.js"></script>
<script src="js/turf/v2.0.2/turf.min.js"></script>
<script src="js/openearthview.js" type="text/javascript"></script>
<script src="js/loaders/TileLoader.js" type="text/javascript"></script>
......@@ -68,7 +69,7 @@
// ]));
world.addLayer(new OpenEarthView.Layer.Building(
"OpenEarthView", [
'http://localhost:8081/3dtile?format=geojson&xtile=${x}&ytile=${y}&zoom=${z}'
'http://localhost:8081/3dtile?format=geojson&xtile=${x}&ytile=${y}&zoom=${z}&factor=${f}'
]));
world.addLayer(new OpenEarthView.Layer.OSM(
......@@ -79,8 +80,9 @@
// UNESCO
// world.setCenter(2.3057599523656336, 48.849568465379264);
// LOUVRE
world.setCenter(2.3364709900972684, 48.86045538042749);
// world.setCenter(2.3364709900972684, 48.86045538042749);
// MANHATTAN
world.setCenter(286.02073690310226, 40.747508647167834);
</script>
</body>
......
......@@ -22,7 +22,7 @@ OpenEarthView.Layer.Building.prototype = {
getName: function() {
return this.name
},
getUrl: function(zoom, xtile, ytile) {
getUrl: function(zoom, xtile, ytile, factor) {
var scope = this;
var urls = OpenEarthViewLayers[scope.name];
var urlRandom = urls[
......@@ -34,7 +34,8 @@ OpenEarthView.Layer.Building.prototype = {
// // console.log("Match!");
// return p1 + zoom + p2 + xtile + p3 + ytile + p4;
// });
var url = urlRandom.replace('${z}', zoom);
var url = urlRandom.replace('${f}', factor);
var url = url.replace('${z}', zoom);
var url = url.replace('${x}', xtile);
return url.replace('${y}', ytile);
// return url;
......
......@@ -78,6 +78,7 @@ THREE.GeojsonLoader.prototype = {
var url = urls[urls.length - 1];
geojsonAliveRequestsCount = geojsonAliveRequestsCount +
(geojsonAliveRequests.hasOwnProperty(url) ? 0 : 1);
console.log('geojsonAliveRequestsCount:', geojsonAliveRequestsCount);
geojsonAliveRequests[url] = geojsonRequests[url];
var onLoad = geojsonAliveRequests[url].onLoad;
var onProgress = geojsonAliveRequests[url].onProgress;
......@@ -93,9 +94,10 @@ THREE.GeojsonLoader.prototype = {
// console.log('geojson:', geojson);
geojsons[url] = geojson;
if (geojsonAliveRequests.hasOwnProperty(url)) {
onLoad(scope.parse(JSON.parse(geojson), lod, defaultColor));
delete geojsonAliveRequests[url];
geojsonAliveRequestsCount--;
console.log('geojsonAliveRequestsCount:', geojsonAliveRequestsCount);
onLoad(scope.parse(JSON.parse(geojson), lod, defaultColor));
}
scope.loadNextGeojson();
}, onProgress,
......@@ -103,6 +105,7 @@ THREE.GeojsonLoader.prototype = {
if (geojsonAliveRequests.hasOwnProperty(url)) {
delete geojsonAliveRequests[url];
geojsonAliveRequestsCount--;
console.log('geojsonAliveRequestsCount:', geojsonAliveRequestsCount);
}
scope.loadNextGeojson();
});
......@@ -232,7 +235,7 @@ THREE.GeojsonLoader.prototype = {
});
var mesh = new THREE.Line(points, material);
mesh.position.z = 1;
// tile.add(mesh);
tile.add(mesh);
}
break;
}
......@@ -278,6 +281,9 @@ THREE.GeojsonLoader.prototype = {
}
for (var blndIdx = 0; blndIdx < coords.length; blndIdx++) {
var coord = coords[blndIdx];
if (coord.length <= 2) {
continue;
}
var x1, y1;
var shapePts = [];
......@@ -297,7 +303,7 @@ THREE.GeojsonLoader.prototype = {
bevelSize: 2,
bevelThickness: 1
};
// console.log('shapePts.length:', shapePts.length);
var geometry = new THREE.ExtrudeGeometry(shape, extrudeSettings);
var material = new THREE.MeshPhongMaterial({
......
......@@ -238,8 +238,8 @@ OpenEarthView.World = function(domElement) {
function updateScene(position) {
// console.log('position.lon:', position.lon);
// console.log('position.lat:', position.lat);
console.log('position.lon:', position.lon);
console.log('position.lat:', position.lat);
scope.xtile = toolbox.long2tile(position.lon, scope.zoom);
scope.ytile = toolbox.lat2tile(position.lat, scope.zoom);
......@@ -271,6 +271,11 @@ OpenEarthView.World = function(domElement) {
}
var currentIds = {};
console.log('position:', JSON.stringify({
zoom: scope.zoom,
xtile: scope.xtile,
ytile: scope.ytile
}));
for (var zoom_ = Math.max(scope.zoom, scope.ZOOM_MIN); zoom_ > Math.max(scope.zoom - scope.ZOOM_SHIFT_SIZE, scope.ZOOM_MIN); zoom_--) {
var zShift = scope.zoom - zoom_;
scope.tileGroup[zShift] = new THREE.Object3D(); //create an empty container
......@@ -377,7 +382,8 @@ OpenEarthView.World = function(domElement) {
currentIds[id] = {};
break;
case 'building':
if (scope.zoom >= 18 && zoom_ >= scope.zoom - 1) {
// if (scope.zoom === 19 && atile === 265544 && btile ===180362) {
if (scope.zoom >= 17 && zoom_ >= scope.zoom - 1) {
var defaultColor =
((13 * scope.zoom) % 256) * 65536 +
((53 * (atile % modulus)) % 256) * 256 +
......@@ -385,7 +391,7 @@ OpenEarthView.World = function(domElement) {
var lod = Math.max(0, zoom_ - 14);
(function(myTile, zoom, xtile, ytile, lod, defaultColor) {
var url = scope.layers[layerIdx].getUrl(
zoom, xtile, ytile);
zoom, xtile, ytile, zoom_ - 16);
scope.geojsonLoader.load(
url,
function(obj) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment