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

setLayerVisibility specified in documentation but not available in library #151

Open
noorbakerally opened this issue Aug 24, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@noorbakerally
Copy link

The setLayerVisibility is documented in the API Documentation here.

However, it's not available in the codes. I need to configure the visibility of certain map layers, such as contour, summit, carparks, etc. Is there another way to do this via the map controller?

@m0nac0
Copy link
Collaborator

m0nac0 commented Aug 24, 2022

This feature was merged in #138, and is not yet in a release. You need to use the main branch from this repo, are you doing that?

@noorbakerally
Copy link
Author

Yes, I found this, I wasn't using the main branch, just to confirm, can we use this for hiding or displaying layers like contour-line, mountain-peak, hike-route, bike-route-line, etc?

@m0nac0
Copy link
Collaborator

m0nac0 commented Aug 25, 2022

Yes, if those layers exist you should be able to hide/show them.

@noorbakerally
Copy link
Author

How about getting a layer object and modifying it's properties?

For example,

I am adding a layer with id tracker as shown below. How do I get the layer object if I need to modify it layer, for example, changing the iconSize or iconRotate property. The future that addSymbolLayer returns does not contain the layer. Neither do I see any method like getLayer or updateLayer. Is there anything such?

 maplibreMapController.addSymbolLayer(
      "trackerSource",
      "tracker",
      SymbolLayerProperties(
          iconImage: "assets/images/NavIcon.png", //  "{type}-15",
          iconSize: 1,
          iconAllowOverlap: true,
          iconRotationAlignment: 'viewport',
          iconPitchAlignment: 'map',
      ),
    );

@m0nac0
Copy link
Collaborator

m0nac0 commented Sep 8, 2022

No this does not exist, yet. The challenge here is that maplibre on iOS does not support retrieving the JSON representation of a source or layer. I have some ideas how to implement this (updating is probably easier than retrieving), but I can't promise you when this will be ready.

If someone is interested in working on this, please let me know and I can give you some more details.

@josxha josxha added the bug Something isn't working label May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants