mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.37k stars 1.33k forks source link

How to add multiple pictures in the same RasterLayer #16558

Closed wingkingbobo closed 3 years ago

wingkingbobo commented 3 years ago

Platform: Mapbox SDK version:

Steps to trigger behavior

1. 2. 3.

Expected behavior

I want to add multiple pictures to the same layer. Instead of creating a new layer every time you add a picture. This can reduce the performance overhead.

            String layerId = "test-layer";
            String sourceId = "test-source";
            LatLngQuad latLngQuad = getLatLngQuad(103.57, 31.17, 104.57, 30.17);
            ImageSource source = new ImageSource(sourceId, latLngQuad, R.drawable.ic_main_3d);
            style.addSource(source);
            RasterLayer layer = new RasterLayer(layerId, sourceId);
            style.addLayer(layer);

Actual behavior