ArrowLineLayer extends KujakuLayer { private void createArrowHeadSource() { arrowHeadSource = new GeoJsonSource(ARROW_HEAD_LAYER_SOURCE_ID , new GeoJsonOptions().withMaxZoom(16)); } private  ArrowLineLayer(@NonNull Builder builder); LineLayer getLineLayer(); SymbolLayer getArrowHeadLayer(); @Override void addLayerToMap(@NonNull MapboxMap mapboxMap); @Override void enableLayerOnMap(@NonNull MapboxMap mapboxMap); @Override void disableLayerOnMap(@NonNull MapboxMap mapboxMap); @Override @NonNull String[] getLayerIds(); @Override boolean removeLayerOnMap(@NonNull MapboxMap mapboxMap); @Override void updateFeatures(@NonNull FeatureCollection featureCollection); static Point getCenter(@NonNull Geometry featureGeometry); @Override FeatureCollection getFeatureCollection(); static final String ARROW_HEAD_BEARING; static final int MIN_ARROW_ZOOM; static final int MAX_ARROW_ZOOM; static final float MIN_ZOOM_ARROW_HEAD_SCALE; static final float MAX_ZOOM_ARROW_HEAD_SCALE; }
@Test public void createArrowHeadSource() throws InvalidArrowLineConfigException { ArrayList<Feature> featuresList = new ArrayList<>(); FeatureCollection featureCollection = FeatureCollection.fromFeatures(featuresList); FeatureFilter.Builder builder = new FeatureFilter.Builder(featureCollection) .whereEq("type", "building"); ArrowLineLayer.FeatureConfig featureConfig = new ArrowLineLayer.FeatureConfig(builder); ArrowLineLayer.SortConfig sortConfig = new ArrowLineLayer.SortConfig("", ArrowLineLayer.SortConfig.SortOrder.DESC, ArrowLineLayer.SortConfig.PropertyType.NUMBER); ArrowLineLayer arrowLineLayer = new ArrowLineLayer.Builder(context, featureConfig, sortConfig).build(); assertNull((GeoJsonSource) ReflectionHelpers.getField(arrowLineLayer, "arrowHeadSource")); ReflectionHelpers.callInstanceMethod(arrowLineLayer, "createArrowHeadSource"); assertNotNull((GeoJsonSource) ReflectionHelpers.getField(arrowLineLayer, "arrowHeadSource")); }