File tree Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -34,8 +34,12 @@ export class FileLayer extends AbstractEmsService {
3434 this . _config = config ;
3535 }
3636
37+ getFields ( ) : FileLayerConfig [ 'fields' ] {
38+ return this . _config . fields ;
39+ }
40+
3741 getFieldsInLanguage ( ) : { type : string ; name : string ; description : string } [ ] {
38- return this . _config . fields . map ( ( field ) => {
42+ return this . getFields ( ) . map ( ( field ) => {
3943 return {
4044 type : field . type ,
4145 name : field . id ,
Original file line number Diff line number Diff line change 1919
2020export { EMSClient } from './ems_client' ;
2121export { ORIGIN } from './origin' ;
22+ export { FileLayer } from './file_layer' ;
23+ export { TMSService } from './tms_service' ;
Original file line number Diff line number Diff line change @@ -151,6 +151,29 @@ describe('ems_client', () => {
151151 const layer = layers [ 0 ] ;
152152 expect ( layer . getId ( ) ) . toBe ( 'world_countries' ) ;
153153 expect ( layer . hasId ( 'world_countries' ) ) . toBe ( true ) ;
154+ expect ( layer . getFields ( ) ) . toMatchObject ( [
155+ {
156+ type : 'id' ,
157+ id : 'iso2' ,
158+ label : {
159+ en : 'ISO 3166-1 alpha-2 code' ,
160+ } ,
161+ } ,
162+ {
163+ type : 'id' ,
164+ id : 'iso3' ,
165+ label : {
166+ en : 'ISO 3166-1 alpha-3 code' ,
167+ } ,
168+ } ,
169+ {
170+ type : 'property' ,
171+ id : 'name' ,
172+ label : {
173+ en : 'name' ,
174+ } ,
175+ } ,
176+ ] ) ;
154177
155178 expect ( layer . getHTMLAttribution ( ) ) . toBe (
156179 '<a rel="noreferrer noopener" href="http://www.naturalearthdata.com/about/terms-of-use">Made with NaturalEarth</a> | <a rel="noreferrer noopener" href="https://www.elastic.co/elastic-maps-service">Elastic Maps Service</a>'
You can’t perform that action at this time.
0 commit comments