Skip to content

Conversation

@bbbbx
Copy link
Contributor

@bbbbx bbbbx commented Oct 13, 2019

Add a new imagery provider to render hexagonal grid for custom rendering effects. Inspired by GridImageryProvider.

Here is the imagery preview:

Screen Shot 2019-10-13 at 20 02 52

@cesium-concierge
Copy link

Thanks for the pull request @bbbbx!

  • ✔️ Signed CLA found.
  • CHANGES.md was not updated.
    • If this change updates the public API in any way, please add a bullet point to CHANGES.md.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
  • Works (or fails gracefully) in IE11.

@OmarShehata
Copy link
Contributor

This looks pretty cool @bbbbx ! Can you share a bit about your use case for making this? I think that would help make the case for whether or not it should be part of the library vs something the application implements.

@bbbbx
Copy link
Contributor Author

bbbbx commented Oct 14, 2019

This looks pretty cool @bbbbx ! Can you share a bit about your use case for making this? I think that would help make the case for whether or not it should be part of the library vs something the application implements.

The use case is developer can use this imagery provider to render custom effects. If the application want to render custom effects, how about use GridImageryProvider to expose a draw function, for example:

Cesium.Viewer('container', {
  imageryProvider: Cesium.GridImageryProvider({
    cells: 3,
    drawGrid: function(context) {
      // `context` is the canvas 2d context,
      // you can use it to draw what you want.
    }
  })
});

then we need to refactoring the Source/GridImageryProvider.js file. @OmarShehata

@OmarShehata
Copy link
Contributor

@bbbbx I think that's definitely a better idea, to make it easier for the developer to construct the specific features they need with the library, as opposed to trying to support every custom shape they might want with a new imagery provider.

For this case, I think you would still be able to do this in your application by defining your custom imagery provider class (kind of like how this Sandcastle defines a custom data source class and uses it). I'm going to close this PR since it's unclear this would be used by enough users to justify adding it to the core library, but I opened this issue to track if this is something more people would use: #8282

We really appreciate your contribution to CesiumJS!

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

Successfully merging this pull request may close these issues.

3 participants