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

How to modify some of the advanced points? #13

Open
geekkid1 opened this issue Nov 22, 2017 · 7 comments
Open

How to modify some of the advanced points? #13

geekkid1 opened this issue Nov 22, 2017 · 7 comments

Comments

@geekkid1
Copy link

I know it's been a while since you committed here, but I hope someone else is looking here. I want to have a straightforward (relatively speaking) guide to editing the advanced points (yellow connected points, satellites). I just want to know what the variables do.

@jjant
Copy link

jjant commented Nov 22, 2017

Yellow connected things are markers (the ones saying Vancouver/Tokyo here https://www.robscanlon.com/encom-globe/).

You add them using the globe.addMarker function (like globe.addMarker(-34.6037, -58.3816, 'Buenos Aires');). And connect a new marker with the previous one by passing true as a fourth argument: globe.addMarker(37.7749, -122.4194, 'San Francisco', true);

@geekkid1
Copy link
Author

Ok I know I’m bad at this, but do I put this in encom_globe.js or what?

@arscan
Copy link
Owner

arscan commented Nov 22, 2017

I really should have a minimal example.. the demo page turned into something far more complicated than necessary for most uses. And now that I look at this a few years later, the API could be a lot better. But it works.

At a minimum you need to do the following:

  1. Include grid.js, which contains the geometry of the sphere: https://github.com/arscan/encom-globe/blob/master/index.html#L23
  2. include the encom globe library: https://github.com/arscan/encom-globe/blob/master/index.html#L26
  3. create a new globe instance, passing height, width, and {tiles: grid.tiles} at a minimum (grid.tiles is created by the grid.js javascript file): https://github.com/arscan/encom-globe/blob/master/index.html#L26
  4. attach the canvas generated by the globe to the dom (uses jquery here, but you can do it with plain javascript): https://github.com/arscan/encom-globe/blob/master/index.html#L59
  5. run the init function (not sure why that isn't in the constructor), which accepts a callback that you should point to your animate function: https://github.com/arscan/encom-globe/blob/master/index.html#L60
  6. have the animate function run globe.tick() https://github.com/arscan/encom-globe/blob/master/index.html#L83
  7. At some point in the future, you can add markers or pins to the globe using globe.addMarker and globe.addPin, which will be animated into existance.

Does that make sense? I believe how this is set up. See index.html for details.

The fact that I look back on this and am embarrassed by how complicated it is means I'm growing as a programmer, right? :)

@geekkid1
Copy link
Author

OK, that still doesn't explain which file I should put the addPin and addMarker calls.

@arscan
Copy link
Owner

arscan commented Nov 22, 2017

You don't need to edit encom-globe.js. You put it wherever you have created your reference to the globe. See https://github.com/arscan/encom-globe/blob/master/index.html, which is an example.

@jjant
Copy link

jjant commented Nov 22, 2017

I'm interested in contributing to this project if you need a hand. I've been using this lib for a few days and also been modifying parts of the source to get it to do what I wanted (this is what I've got so far: https://puu.sh/yrrhi/bd74fe71e8.png).

So if you are interested in improving this project, I could help out in a few weeks.

@arscan
Copy link
Owner

arscan commented Nov 22, 2017

@jjant -- I'm happy to take any contributions, as long as are things other developers might find useful, and that they still allow me to to configure the globe to look like what is on https://www.robscanlon.com/encom-boardroom. Thanks!

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

3 participants