1 package fr.ifremer.dali.map;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 import fr.ifremer.dali.map.config.*;
25 import fr.ifremer.quadrige3.core.dao.technical.enumeration.EnumValue;
26
27 import java.util.List;
28
29 import static org.nuiton.i18n.I18n.n;
30 import static org.nuiton.i18n.I18n.t;
31
32
33
34
35
36
37 public enum MapMode implements EnumValue {
38
39 EMBEDDED_SHAPE_MAP_MODE("EMB_SHAPE", n("dali.core.enums.mapMode.embeddedShape"), new EmbeddedShapeMapConfiguration()),
40
41 SEXTANT_WMTS_MAP_MODE("WMTS_SEXTANT", n("dali.core.enums.mapMode.sextantWMTS"), new SextantWMTSMapConfiguration()),
42 OSM_MAP_MODE("OSM", n("dali.core.enums.mapMode.openStreetMap"), new OSMMapConfiguration()),
43 OTM_MAP_MODE("OTM", n("dali.core.enums.mapMode.openTopoMap"), new OTMMapConfiguration()),
44 CARTO_BASE_MAP_MODE("VOYAGER", n("dali.core.enums.mapMode.cartoBase"), new CartoBaseMapConfiguration()),
45 SATELLITE_MAP_MODE("SATELLITE", n("dali.core.enums.mapMode.satellite"), new SatelliteMapConfiguration());
46
47 private final String code;
48 private final String i18nKey;
49 private final MapConfiguration mapConfiguration;
50
51 MapMode(String code, String i18nKey, MapConfiguration mapConfiguration) {
52 this.code = code;
53 this.i18nKey = i18nKey;
54 this.mapConfiguration = mapConfiguration;
55 }
56
57 @Override
58 public String getCode() {
59 return code;
60 }
61
62 @Override
63 public String getLabel() {
64 return t(i18nKey);
65 }
66
67 public MapConfiguration getMapConfiguration() {
68 return mapConfiguration;
69 }
70
71 public boolean isOnline() {
72 return mapConfiguration.isOnline();
73 }
74
75 public String getUrl() {
76 return mapConfiguration.getUrl();
77 }
78
79 public String getBaseLayerName() {
80 return mapConfiguration.getBaseLayerName();
81 }
82
83 public List<MapLayerDefinition> getMapLayerDefinitions() {
84 return mapConfiguration.getMapLayerDefinitions();
85 }
86
87 public boolean isProgressiveRender() {
88 return mapConfiguration.isProgressiveRender();
89 }
90
91 public boolean isTransparent() {
92 return mapConfiguration.isTransparent();
93 }
94
95 }