Skip to content

Commit

Permalink
add support to open OGC:COG links in the external viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
landryb committed Oct 9, 2023
1 parent c758688 commit 7c7fb62
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
return r.mimeType;
} else if (r.protocol && r.protocol.indexOf("WWW:DOWNLOAD:") >= 0) {
return r.protocol.replace("WWW:DOWNLOAD:", "");
} else if (mainType.match(/W([MCF]|MT)S.*|3DTILES|ESRI:REST/) != null) {
} else if (mainType.match(/W([MCF]|MT)S.*|3DTILES|COG|ESRI:REST/) != null) {
return mainType.replace("SERVICE", "");
} else if (mainType.match(/KML|GPX/) != null) {
return mainType;
Expand Down Expand Up @@ -128,6 +128,8 @@
gnViewerSettings.resultviewFns && gnViewerSettings.resultviewFns.addMdLayerToMap;
var add3dTilesToMap =
gnViewerSettings.resultviewFns && gnViewerSettings.resultviewFns.addMdLayerToMap;
var addCogeoToMap =
gnViewerSettings.resultviewFns && gnViewerSettings.resultviewFns.addMdLayerToMap;
var addEsriRestToMap =
gnViewerSettings.resultviewFns && gnViewerSettings.resultviewFns.addMdLayerToMap;

Expand Down Expand Up @@ -286,6 +288,11 @@
label: "addToMap",
action: add3dTilesToMap
},
COG: {
iconClass: "fa-globe",
label: "addToMap",
action: addCogeoToMap
},
TMS: {
iconClass: "fa-globe",
label: "addToMap",
Expand Down Expand Up @@ -517,6 +524,8 @@
return "WMTS";
} else if (protocolOrType.match(/3dtiles/i)) {
return "3DTILES";
} else if (protocolOrType.match(/cog/i)) {
return "COG";
} else if (protocolOrType.match(/tms/i)) {
return "TMS";
} else if (protocolOrType.match(/wfs/i)) {
Expand Down
1 change: 1 addition & 0 deletions web-ui/src/main/resources/catalog/js/CatController.js
Original file line number Diff line number Diff line change
Expand Up @@ -1311,6 +1311,7 @@
layers: [
"OGC:WMS",
"OGC:3DTILES",
"OGC:COG",
"OGC:WMTS",
"OGC:WMS-1.1.1-http-get-map",
"OGC:WMS-1.3.0-http-get-map",
Expand Down
1 change: 1 addition & 0 deletions web-ui/src/main/resources/catalog/style/gn_icons.less
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@
.gn-icontype-wcs,
.gn-icontype-atom,
.gn-icontype-3dtiles,
.gn-icontype-cog,
.gn-icontype-esri-rest,
.gn-icontype-wfs {
background-color: @btn-success-bg !important;
Expand Down
2 changes: 2 additions & 0 deletions web-ui/src/main/resources/catalog/views/default/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@
? "esrirest"
: link.protocol == "OGC:3DTILES"
? "3dtiles"
: link.protocol == "OGC:COG"
? "cog"
: "wms",
url: $filter("gnLocalized")(link.url) || link.url
};
Expand Down

0 comments on commit 7c7fb62

Please sign in to comment.