Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
cmangeat committed Sep 28, 2023
1 parent f9086a9 commit 82e37d1
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
<jsSource webappPath="/catalog/lib/style/bootstrap/dist/js/bootstrap.min.js" minimize="false"/>
<jsSource webappPath="/catalog/lib/proj4js-compressed.js" minimize="false"/>
<jsSource webappPath="/catalog/lib/openlayers/ol.js" minimize="false"/>
<jsSource webappPath="/catalog/lib/openlayers/olms.js" minimize="false"/>
<jsSource webappPath="/catalog/lib/openlayers/" minimize="false"/>
<jsSource webappPath="/catalog/lib/d3.v3.min.js" minimize="false"/>
<jsSource webappPath="/catalog/lib/nv.d3.min.js" minimize="false"/>
<jsSource webappPath="/catalog/lib/jsonix/jsonix/Jsonix-min.js" minimize="false"/>
Expand Down Expand Up @@ -136,6 +138,7 @@
<!-- FIXME in non debug mode, 3D mode does not work when WMS layer is displayed.
No errors, only block tile loading-->
<jsSource webappPath="/catalog/lib/openlayers/ol.js" minimize="false"/>
<jsSource webappPath="/catalog/lib/openlayers/olms.js" minimize="false"/>
<jsSource webappPath="/catalog/lib/olcesium/olcesium.js" minimize="false"/>
<jsSource webappPath="/catalog/lib/d3.v3.min.js" minimize="false"/>
<jsSource webappPath="/catalog/lib/nv.d3.min.js" minimize="false"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1811,33 +1811,45 @@
});
},

buildMapGeoAdminBaseLayerWorld: function (layer) {
layer = new ol.layer.VectorTile({
opacity: 1,
declutter: true
});
olms.applyStyle(
layer,
"https://vectortiles.geo.admin.ch/styles/ch.swisstopo.leichte-basiskarte_world.vt/style.json",
"openmaptiles"
);
return layer;
},

buildMapGeoAdminBaseLayerRelief: function (layer) {
var defaultUrl =
"https://world.vectortiles.geo.admin.ch/mbtiles/org.openmaptiles-relief.vt/{z}/{x}/{y}.jpg";
return new ol.layer.Tile({
source: new ol.source.XYZ({
url: defaultUrl,
projection: "EPSG:3857"
})
layer = new ol.layer.VectorTile({
opacity: 1
});
olms.applyStyle(
layer,
"https://vectortiles.geo.admin.ch/styles/ch.swisstopo.leichte-basiskarte_world.vt/style.json",
"terrain_v1.0.0"
);
return layer;
},

buildMapGeoAdminBaseLayer: function (layer) {
var defaultUrl =
"https://world.vectortiles.geo.admin.ch/mbtiles/org.openstreetmap-openmaptiles.vt/{z}/{x}/{y}.pbf";

return new ol.layer.VectorTile({
source: new ol.source.VectorTile({
url: defaultUrl,
format: new ol.format.MVT(),
projection: "EPSG:3857",
extent: [
-20037508.342789244, -20037471.205137063, 20037508.342789244,
20037471.205137063
]
}),
layer = new ol.layer.VectorTile({
declutter: true,
opacity: 0.5
});
olms.applyStyle(
layer,
"https://vectortiles.geo.admin.ch/styles/ch.swisstopo.leichte-basiskarte_world.vt/style.json",
"leichtebasiskarte_v3.0.0"
);
return layer;
},

/**
Expand Down Expand Up @@ -2333,6 +2345,8 @@
return this.buildMapGeoAdminBaseLayer(opt.name);
case "relief":
return this.buildMapGeoAdminBaseLayerRelief(opt.name);
case "world":
return this.buildMapGeoAdminBaseLayerWorld(opt.name);
}
},

Expand Down
2 changes: 1 addition & 1 deletion web-ui/src/main/resources/catalog/lib/openlayers/ol.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 2 additions & 8 deletions web-ui/src/main/resources/catalog/lib/openlayers/ol.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web-ui/src/main/resources/catalog/lib/openlayers/ol.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions web-ui/src/main/resources/catalog/lib/openlayers/olms.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

<!-- No 3D. -->
<script src="/geonetwork/catalog/lib/openlayers/ol.js"></script>
<script src="/geonetwork/catalog/lib/openlayers/olms.js"></script>

<script src="/geonetwork/catalog/lib/FileSaver/FileSaver.min.js"></script>
<script src="/geonetwork/catalog/lib/tableExport/tableExport.min.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,19 @@
opacity="1">
<ows:Title>map.geo.admin.ch</ows:Title>
</ows-context:Layer>

<ows-context:Layer name="{type=world,name=world}"
group="Background layers"
hidden="false"
opacity="0.5">
<ows:Title>map.geo.admin.ch</ows:Title>
</ows-context:Layer>
<ows-context:Layer name="{type=contour,name=contour}"
group="Background layers"
hidden="false"
opacity="0.5">
<ows:Title>map.geo.admin.ch</ows:Title>


</ows-context:Layer>


Expand Down
1 change: 1 addition & 0 deletions web/src/main/webapp/xslt/base-layout-cssjs-loader.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
</xsl:when>
<xsl:otherwise>
<script src="{$uiResourcesPath}lib/openlayers/ol.js?v={$buildNumber}"></script>
<script src="{$uiResourcesPath}lib/openlayers/olms.js?v={$buildNumber}"></script>
</xsl:otherwise>
</xsl:choose>

Expand Down

0 comments on commit 82e37d1

Please sign in to comment.