use of androidx.annotation.UiThread in project mapbox-plugins-android by mapbox.
the class FillManager method create.
/**
* Create a list of fills on the map.
* <p>
* Fills are going to be created only for features with a matching geometry.
* <p>
* All supported properties are:<br>
* FillOptions.PROPERTY_FILL_OPACITY - Float<br>
* FillOptions.PROPERTY_FILL_COLOR - String<br>
* FillOptions.PROPERTY_FILL_OUTLINE_COLOR - String<br>
* FillOptions.PROPERTY_FILL_PATTERN - String<br>
* Learn more about above properties in the <a href="https://www.mapbox.com/mapbox-gl-js/style-spec/">Style specification</a>.
* <p>
* Out of spec properties:<br>
* "is-draggable" - Boolean, true if the fill should be draggable, false otherwise
*
* @param featureCollection the featureCollection defining the list of fills to build
* @return the list of built fills
*/
@UiThread
public List<Fill> create(@NonNull FeatureCollection featureCollection) {
List<Feature> features = featureCollection.features();
List<FillOptions> options = new ArrayList<>();
if (features != null) {
for (Feature feature : features) {
FillOptions option = FillOptions.fromFeature(feature);
if (option != null) {
options.add(option);
}
}
}
return create(options);
}
use of androidx.annotation.UiThread in project mapbox-plugins-android by mapbox.
the class SymbolManager method create.
/**
* Create a list of symbols on the map.
* <p>
* Symbols are going to be created only for features with a matching geometry.
* <p>
* All supported properties are:<br>
* SymbolOptions.PROPERTY_SYMBOL_SORT_KEY - Float<br>
* SymbolOptions.PROPERTY_ICON_SIZE - Float<br>
* SymbolOptions.PROPERTY_ICON_IMAGE - String<br>
* SymbolOptions.PROPERTY_ICON_ROTATE - Float<br>
* SymbolOptions.PROPERTY_ICON_OFFSET - Float[]<br>
* SymbolOptions.PROPERTY_ICON_ANCHOR - String<br>
* SymbolOptions.PROPERTY_TEXT_FIELD - String<br>
* SymbolOptions.PROPERTY_TEXT_FONT - String[]<br>
* SymbolOptions.PROPERTY_TEXT_SIZE - Float<br>
* SymbolOptions.PROPERTY_TEXT_MAX_WIDTH - Float<br>
* SymbolOptions.PROPERTY_TEXT_LETTER_SPACING - Float<br>
* SymbolOptions.PROPERTY_TEXT_JUSTIFY - String<br>
* SymbolOptions.PROPERTY_TEXT_RADIAL_OFFSET - Float<br>
* SymbolOptions.PROPERTY_TEXT_ANCHOR - String<br>
* SymbolOptions.PROPERTY_TEXT_ROTATE - Float<br>
* SymbolOptions.PROPERTY_TEXT_TRANSFORM - String<br>
* SymbolOptions.PROPERTY_TEXT_OFFSET - Float[]<br>
* SymbolOptions.PROPERTY_ICON_OPACITY - Float<br>
* SymbolOptions.PROPERTY_ICON_COLOR - String<br>
* SymbolOptions.PROPERTY_ICON_HALO_COLOR - String<br>
* SymbolOptions.PROPERTY_ICON_HALO_WIDTH - Float<br>
* SymbolOptions.PROPERTY_ICON_HALO_BLUR - Float<br>
* SymbolOptions.PROPERTY_TEXT_OPACITY - Float<br>
* SymbolOptions.PROPERTY_TEXT_COLOR - String<br>
* SymbolOptions.PROPERTY_TEXT_HALO_COLOR - String<br>
* SymbolOptions.PROPERTY_TEXT_HALO_WIDTH - Float<br>
* SymbolOptions.PROPERTY_TEXT_HALO_BLUR - Float<br>
* Learn more about above properties in the <a href="https://www.mapbox.com/mapbox-gl-js/style-spec/">Style specification</a>.
* <p>
* Out of spec properties:<br>
* "is-draggable" - Boolean, true if the symbol should be draggable, false otherwise
*
* @param featureCollection the featureCollection defining the list of symbols to build
* @return the list of built symbols
*/
@UiThread
public List<Symbol> create(@NonNull FeatureCollection featureCollection) {
List<Feature> features = featureCollection.features();
List<SymbolOptions> options = new ArrayList<>();
if (features != null) {
for (Feature feature : features) {
SymbolOptions option = SymbolOptions.fromFeature(feature);
if (option != null) {
options.add(option);
}
}
}
return create(options);
}
Aggregations