|
59 | 59 | label: "addToMap", |
60 | 60 | filterFn: function (record) { |
61 | 61 | var md = new Metadata(record); |
62 | | - return md.getLinksByType("OGC:WMS").length > 0; |
| 62 | + const linkTypes = [ |
| 63 | + "OGC:WMS", |
| 64 | + "ESRI REST: Map Service", |
| 65 | + "ESRI REST: Map Server" |
| 66 | + ]; |
| 67 | + // returns true as soon as any type has ≥1 link |
| 68 | + return linkTypes.some(type => md.getLinksByType(type).length > 0); |
63 | 69 | }, |
64 | 70 | fn: function (uuids, records) { |
65 | 71 | for (var i = 0; i < uuids.length; i++) { |
|
95 | 101 | } |
96 | 102 | }); |
97 | 103 | }); |
| 104 | + |
| 105 | + const esriLinks = [ |
| 106 | + ...md.getLinksByType("ESRI REST: Map Server"), |
| 107 | + ...md.getLinksByType("ESRI REST: Map Service") |
| 108 | + ]; |
| 109 | + |
| 110 | + angular.forEach(esriLinks, function (link) { |
| 111 | + if (gnMap.isLayerInMap(viewerMap, link.name, link.url)) { |
| 112 | + return; |
| 113 | + } |
| 114 | + |
| 115 | + gnMap |
| 116 | + .addEsriRestLayer(viewerMap, link.url, link.name, false, md) |
| 117 | + .then(function (layer) { |
| 118 | + if (layer) { |
| 119 | + gnMap.feedLayerWithRelated(layer, link.group); |
| 120 | + } |
| 121 | + }); |
| 122 | + |
| 123 | + }); |
| 124 | + |
98 | 125 | } |
99 | 126 | }, |
100 | 127 | icon: "fa-globe" |
|
197 | 224 | .post( |
198 | 225 | "../api/search/records/_search", |
199 | 226 | { |
200 | | - _source: { includes: ["uuid", "root", "resourceTitle*", "isTemplate"] }, |
| 227 | + _source: { |
| 228 | + includes: ["uuid", "root", "resourceTitle*", "isTemplate", "link"] |
| 229 | + }, |
201 | 230 | from: 0, |
202 | 231 | size: 2000, |
203 | 232 | query: { |
|
0 commit comments