Giter Site home page Giter Site logo

Comments (5)

dmlitvinov avatar dmlitvinov commented on May 8, 2024 1

We have exactly the same problem. There is no error without specifying an index, but there is no way to set the correct layer order

from maps.

stale avatar stale commented on May 8, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from maps.

systemlevel avatar systemlevel commented on May 8, 2024

Is this layer index property working for anybody else?

from maps.

anfriis avatar anfriis commented on May 8, 2024

I just stumbled across the same issue - but only on iOS.
Android is fine with setting the `layerIndex´ prop.

The crash seems to happen here. I don't know why the style apparently have no layers when running on iOS. I tried to set layerIndex after a delay when the map and all layers have rendered, but it crashes immediately when setting the prop.

As a workaround, I used the aboveLayerID (belowLayerId could be used as well I suppose), for all my layers, even though they are not in the same ShapeSource and that works fine for both iOS and Android.

from maps.

anfriis avatar anfriis commented on May 8, 2024

I tried #361 in my project with setting layerIndex instead of aboveLayerId.
The layers in my map style (street names, etc.) are placed rather high up with the highest being around layerIndex 40-42.
I want my own layers to be placed above all the map's own layers, so if I set layerIndex to 50 for my own layer, I get:
Terminating app due to uncaught exception 'NSRangeException', reason: 'Cannot insert style layer at out-of-bounds index 50.
I have 14 layers on my map, so I have to use the 8 indexes between 42 and 50, and rely on aboveLayerId layers in the same ShapeSource.

Does anyone know why it is not possible to use an index >= 50?
@mfazekas

Versions (please complete the following information):

Platfrom: iOS
React Native Version 0.59.9

from maps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.