question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow user to override draw function in GridImageryProvider

See original GitHub issue

This came up in https://github.com/AnalyticalGraphicsInc/cesium/pull/8280. The idea is to make it easy for the developer to create effects like this hexagonal grid by allowing them to override the draw function in the GridImageryProvider:

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.
    }
  })
});

grid

Is this something you would use in your application? If so, please 👍 or describe your use case in this issue. Right now this is still possible to do by creating a custom imagery provider based off of the GridImageryProvider in your application.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:6
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
ghostcommented, Aug 7, 2020

I`m also trying to build a MGRS grid, kinda like a lat/long grid, but a bit more complex. So I need to take into consideration zoom, camera position and so on, and an imageryprovider this flexible would be great to work with.

0reactions
AOldDriverAcommented, Oct 29, 2019

The grid I’m drawing now is DQG( degenerate quadtree grid) based on primitives:

Now I can’t draw it on tiles, because if you project it in two dimensions:

Since I can’t draw DQG based on quadtree tiles, I draw them with primitives: Cesium.RectangleOutline and Cesium.Rectangle. Drawing grids with primitives have some problems such as linewidth is 1 and have to compute a lot every frame. So I want to draw it based on tiles. But I don’t know how to tile map following DQG scheme. I will be more than happy to share my ideas and code if I solve this problem. (Excuse my poooooor English) Sent from Mail for Windows 10 From: Omar Shehata Sent: 2019年10月24日 21:11 To: AnalyticalGraphicsInc/cesium Cc: AOldDriverA; Mention Subject: Re: [AnalyticalGraphicsInc/cesium] Allow user to override drawfunction in GridImageryProvider (#8282)

@AOldDriverA can you share a bit about your application and what you’re visualizing with a custom grid? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Allow user to override draw function in GridImageryProvider
The grid I'm drawing now is DQG( degenerate quadtree grid) based on primitives: Now I can't draw it on tiles, because if you...
Read more >
UIView with draw function override… | Apple Developer Forums
My UIView is always drawn in the same place regardless of where I have placed it in Interface Builder, if I have the...
Read more >
GridImageryProvider - Cesium Documentation
An ImageryProvider that draws a wireframe grid on every tile with controllable background and glow. May be useful for custom rendering effects or...
Read more >
Overriding draw function in UIView class of iOS - Stack Overflow
When I am creating object of this class, I observed that I don't need to call "draw" function separately and it still draws...
Read more >
Rectangle following an object - Google Groups
When you use "viewer.clock.startTime", I believe it's going to be trying to look up the position of the object at the time you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found