Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to place LocationPuck3D below map 3d models (specifically building extrusions) #660

Open
Log-Mushun opened this issue Aug 21, 2024 · 0 comments

Comments

@Log-Mushun
Copy link

Log-Mushun commented Aug 21, 2024

I'm currently using the Mapbox Standard style, but I've attempted to create a custom style where I added a layer for building extrusions. However, the issue persists— my LocationPuck3D still renders above the building extrusions, despite my efforts.

I used the following code to try to move the LocationPuck3D layer below the building extrusions:

_mapboxMap?.style.moveStyleLayer('mapbox-location-model-layer', LayerPosition(below: 'building-extrusion'));

This did indeed move the layer but the model was still displayed over the buildings.

additionally, I’ve tried configuring the LocationPuck3D slot in the LayerSlot.MIDDLE but it didn't work, I tried specifying the layerBelow parameter directly in the settings, but neither approach has worked:

  Future<void> _enableLocationComponent() async {
    _mapboxMap?.location.updateSettings(
      LocationComponentSettings(
        locationPuck: LocationPuck(
          locationPuck3D: LocationPuck3D(
            modelUri:
                "https://raw.githubusercontent.com/Log-Mushun/TSP_models/main/Truck_pkg_1_glb.glb",
            modelScale: [1, 1, 1],
            modelScaleMode: ModelScaleMode.MAP,
          ),
        ),
        enabled: true,
        puckBearingEnabled: true,
        slot: LayerSlot.MIDDLE,
        //layerBelow: 'building-extrusion', (I also tried this)
      ),
    );
  }

So I wanted to see if LayerSlot.BOTTOM works and it looks weird, It's like the puck model appears under the roads but still above the buildings, with a theme that has a custom layer for 3d buildings the same thing happens

bottom

I'm testing on an android device .

my mapbox version is: mapbox_maps_flutter: ^2.1.0

@Log-Mushun Log-Mushun changed the title Not able to position LocationPuck3D below map 3d models (specifically building extrusions) Not able to place LocationPuck3D below map 3d models (specifically building extrusions) Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant