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

Looking for a cartagen theory-of-operation regarding Map, Glop, and Viewport #108

Open
jmullaney2003 opened this issue Jan 17, 2020 · 1 comment

Comments

@jmullaney2003
Copy link

There is a gap between the wiki and the source code.
The wiki contains some explanations about specific classes, and, of course, the source contains everything. I don't see the relationship between classes. I’m having trouble grasping a basic theory of operation.

Example: what is the difference (or relationship) between the Map, Glop, and Viewport?
In particular, what is difference between Map.draw() and Glop.draw();

@jywarren
Copy link
Owner

Hi, so Glop is a set of convenience methods for (HTML) canvas operations, including a draw function, resizing, and some events stuff:

https://github.com/jywarren/cartagen/blob/master/src/glop/glop.js

Map has most of the map projection and lat/lon coord math utility functions.

https://github.com/jywarren/cartagen/blob/master/src/mapping/map.js

Viewport manages the rectangle that is being viewed through the browser window frame, and because Cartagen typically works in vector tiles, it also tracks the vector tiles which intersect with the browser viewport frame, so we can do efficient "culling" of data to render.

I hope this helps!

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

2 participants