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

Add a maps component #21

Open
Dev1an opened this issue Jun 9, 2016 · 11 comments
Open

Add a maps component #21

Dev1an opened this issue Jun 9, 2016 · 11 comments
Assignees

Comments

@Dev1an
Copy link
Contributor

Dev1an commented Jun 9, 2016

No description provided.

@jeroenbe
Copy link
Contributor

After several attempts spread over the last view days, I'm running out of options. Some help would be greatly appreciated

@Dev1an
Copy link
Contributor Author

Dev1an commented Jun 11, 2016

I'm first going to close #11 and #22, after that I will look into it.

@Dev1an
Copy link
Contributor Author

Dev1an commented Jun 11, 2016

@jeroenbe: Have you tried to wrap the code inside a meteor 1.3 module? Did you ask the mapbox/leaflet/google-maps community for some help?

@jeroenbe
Copy link
Contributor

There is quite some community chatter about the issue, both on the Leaflet github page as in the npm community surrounding Mapbox. Even dedicated Atmosphere packages concerning mapbox receive a fair share of complaints.

I browsed to pretty much all of them and tried everything they suggested, without luck. I asked around on a newly created thread on the meteor forums, here someone suggested using a script tag with the actual mapbox-gl.js files. Up un till now, this is they only suggestion that works. Sadly I find it a rather dirty one, but pragmatically, it should suffice for now.

My next step would be to include my findings in the Visualisation project.

@jeroenbe
Copy link
Contributor

Concerning Access Tokens

After reading the explanation of the mapbox access tokens, I feel tempted to just put them in the Template code instead of placing them in a settings file on startup. It would be great if I could here some opinions on the matter.

FYI, the access token I generated to my account starts with pk, as explained on the mapbox documentation.

@Dev1an @Kymer @maccradar

@jeroenbe
Copy link
Contributor

It appears FlowRouter is causing some troubles with the script tag. The variable mapboxgl can not be found in the map template. While it was perfectly found in my test project. I will have to look into resolving this.

@maccradar
Copy link
Collaborator

Have you tried to add it to "onRendered"? The meteor script is typically run before the other APIs, such as google maps, leaflet, mapbox, are loaded, so they recommend to put your code in a Template.onRendered: see Template.rendered.

@jeroenbe
Copy link
Contributor

jeroenbe commented Jun 13, 2016

@maccradar Yes all code has been placed in onRendered. I created a repository in order to do some experiments. Whenever the code related to mapbox is placed in the /client folder (outside the /imports folder), everything appears to work. But when I need to import bits of code (following the ES6 standard), I seem to get into trouble.

@jeroenbe
Copy link
Contributor

I will try to place all mapbox related files inside an Atmosphere package. See how things go from there on out...

@maccradar
Copy link
Collaborator

Just confirmed the same. Running it in client works "out of the box". I suggest you leave it there and leave the issue open. Unless you cannot proceed when the code is not imported.

On 13 Jun 2016, at 10:41, Jeroen <notifications@github.commailto:notifications@github.com> wrote:

@maccradarhttps://github.com/maccradar Yes all code has been placedin onRendered. I created a repository in order to do some experiments. Whenever the code related to mapbox is placed in the /client folder (outside the /imports folder), everything appears to work. But when I need to import bits of code (following the ES6 standard), I seem to get into trouble.

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com//issues/21#issuecomment-225520753, or mute the threadhttps://github.com/notifications/unsubscribe/AFH8apNJNx56-8Ys1wgt2wXkDBK5oyi2ks5qLRd3gaJpZM4IxyVh.

@Kymer
Copy link
Member

Kymer commented Jun 13, 2016

I feel tempted to just put them in the Template code instead of placing them in a settings file on startup. It would be great if I could here some opinions on the matter.

Be careful when adding access tokens in public code files. There are crawlers that look specifically for oauth tokens of various API vendors, which can then be abused in some form. Your account could get banned from accessing the service if your amount of requests pass a certain threshold for example.

I'm not really sure what the best practices are concerning API access tokens in open-source projects... maybe others can shed some light on that? @Dev1an @maccradar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants
@Dev1an @maccradar @jeroenbe @Kymer and others