summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/Style.java
blob: 6f7234a90cfccfa80307671720091408b6b6e95e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
package com.mapbox.mapboxsdk.constants;

import android.support.annotation.IntRange;
import android.support.annotation.StringDef;

import com.mapbox.mapboxsdk.maps.MapView;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Locale;

/**
 * <p>
 * Style provides URLs to several professional styles designed by Mapbox.
 * </p>
 * These styles are all ready to go in your app. To load one, pass it into {@link MapView#setStyleUrl(String)}
 *
 * @see MapView#setStyleUrl(String)
 */
public class Style {

    /**
     * Mapbox Streets: A complete basemap, perfect for incorporating your own data.
     */
    private static final String MAPBOX_STREETS_BASE = "mapbox://styles/mapbox/streets-v%d";
    /**
     * Outdoors: A general-purpose style tailored to outdoor activities.
     */
    private static final String OUTDOORS_BASE = "mapbox://styles/mapbox/outdoors-v%d";
    /**
     * Light: Subtle light backdrop for data visualizations.
     */
    private static final String LIGHT_BASE = "mapbox://styles/mapbox/light-v%d";
    /**
     * Dark: Subtle dark backdrop for data visualizations.
     */
    private static final String DARK_BASE = "mapbox://styles/mapbox/dark-v%d";
    /**
     * Satellite: A beautiful global satellite and aerial imagery layer.
     */
    private static final String SATELLITE_BASE = "mapbox://styles/mapbox/satellite-v%d";
    /**
     * Satellite Streets: Global satellite and aerial imagery with unobtrusive labels.
     */
    private static final String SATELLITE_STREETS_BASE = "mapbox://styles/mapbox/satellite-hybrid-v%d";

    /**
     * Get versioned url of Mapbox streets style.
     * <p>
     * <ul>
     * <li>Current default version is 9.</li>
     * </ul
     * </p>
     * <p>
     * More information on the Mapbox styles API can be found on https://www.mapbox.com/api-documentation/#styles
     * </p>
     *
     * @param version the version of the style.
     * @return uri to load style from
     */
    public static String getMapboxStreetsUrl(int version) {
        return String.format(Locale.US, MAPBOX_STREETS_BASE, version);
    }

    /**
     * Get versioned url of Outdoors streets style.
     * <p>
     * <ul>
     * <li>Current version is 9.</li>
     * </ul>
     * </p>
     * <p>
     * More information on the Mapbox styles API can be found on https://www.mapbox.com/api-documentation/#styles
     * </p>
     *
     * @param version the version of the style.
     * @return uri to load style from
     */
    public static String getOutdoorsStyleUrl(int version) {
        return String.format(Locale.US, OUTDOORS_BASE, version);
    }

    /**
     * Get versioned url of Light style.
     * <p>
     * <ul>
     * <li>Current default version is 9.</li>
     * </ul>
     * </p>
     * <p>
     * More information on the Mapbox styles API can be found on https://www.mapbox.com/api-documentation/#styles
     * </p>
     *
     * @param version the version of the style.
     * @return uri to load style from
     */
    public static String getLightStyleUrl(int version) {
        return String.format(Locale.US, LIGHT_BASE, version);
    }

    /**
     * Get versioned url of Dark style.
     * <p>
     * <ul>
     * <li>Current default version is 9.</li>
     * </ul>
     * </p>
     * <p>
     * More information on the Mapbox styles API can be found on https://www.mapbox.com/api-documentation/#styles
     * </p>
     *
     * @param version the version of the style.
     * @return uri to load style from
     */
    public static String getDarkStyleUrl(int version) {
        return String.format(Locale.US, DARK_BASE, version);
    }

    /**
     * Get versioned url of Satellite style.
     * <p>
     * <ul>
     * <li>Current version is 9.</li>
     * </ul>
     * </p>
     * <p>
     * More information on the Mapbox styles API can be found on https://www.mapbox.com/api-documentation/#styles
     * </p>
     *
     * @param version the version of the style.
     * @return uri to load style from
     */
    public static String getSatelliteStyleUrl(int version) {
        return String.format(Locale.US, SATELLITE_BASE, version);
    }

    /**
     * Get versioned url of Satellite streets style.
     * <p>
     * <ul>
     * <li>Current version is 9.</li>
     * </ul>
     * </p>
     * <p>
     * More information on the Mapbox styles API can be found on https://www.mapbox.com/api-documentation/#styles
     * </p>
     *
     * @param version the version of the style.
     * @return uri to load style from
     */
    public static String getSatelliteStreetsStyleUrl(int version) {
        return String.format(Locale.US, SATELLITE_STREETS_BASE, version);
    }

    /**
     * Indicates the parameter accepts one of the values from {@link Style}.
     *
     * @deprecated use dedicated versioned methods in {@link Style} instead.
     */
    @StringDef({MAPBOX_STREETS, EMERALD, LIGHT, DARK, SATELLITE, SATELLITE_STREETS})
    @Retention(RetentionPolicy.SOURCE)
    @Deprecated
    public @interface StyleUrl {
    }

    // IMPORTANT: If you change any of these you also need to edit them in strings.xml

    /**
     * Mapbox Streets: A complete basemap, perfect for incorporating your own data.
     *
     * @deprecated use {@link #getMapboxStreetsUrl(int)} instead.
     */
    @Deprecated
    public static final String MAPBOX_STREETS = "mapbox://styles/mapbox/streets-v9";

    /**
     * Emerald: A versatile style, with emphasis on road networks and public transit.
     *
     * @deprecated this style has been deprecated and will be removed in future versions.
     */
    @Deprecated
    public static final String EMERALD = "mapbox://styles/mapbox/emerald-v8";

    /**
     * Light: Subtle light backdrop for data visualizations.
     *
     * @deprecated use {@link #getLightStyleUrl(int)} instead.
     */
    @Deprecated
    public static final String LIGHT = "mapbox://styles/mapbox/light-v9";

    /**
     * Dark: Subtle dark backdrop for data visualizations.
     *
     * @deprecated use {@link #getDarkStyleUrl(int)} (int)} instead.
     */
    @Deprecated
    public static final String DARK = "mapbox://styles/mapbox/dark-v9";

    /**
     * Satellite: A beautiful global satellite and aerial imagery layer.
     *
     * @deprecated use {@link #getSatelliteStyleUrl(int)} instead.
     */
    @Deprecated
    public static final String SATELLITE = "mapbox://styles/mapbox/satellite-v9";

    /**
     * Satellite Streets: Global satellite and aerial imagery with unobtrusive labels.
     *
     * @deprecated use {@link #getSatelliteStreetsStyleUrl(int)} (int)} instead.
     */
    @Deprecated
    public static final String SATELLITE_STREETS = "mapbox://styles/mapbox/satellite-hybrid-v9";
}