-
Notifications
You must be signed in to change notification settings - Fork 145
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
help using with requirejs #18
Comments
I got it working with just this code: <script type="text/javascript" src="scripts/require.js"></script>
<script>
require([
"scripts/satellite.js/dist/satellite",
], function(satellite){
console.log(satellite);
/* your satellite code here */
});
</script> The folder structure is as follows:
Another unrelated note: This works with Esri's JS API too, just make sure to put the "dojo/domReady!" dependency last or else you will receive errors like |
Given how old this issue is, can we close it? |
Yes please, can close it off, thanks for asking!
…On Sun., 16 Sep. 2018, 11:56 Theodore Kruczek, ***@***.***> wrote:
Given how old this issue is, can we close it?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMX6NN7AqvjfWy_ITkajeETeX-G_eFAeks5ubnTHgaJpZM4Ff2VW>
.
|
I created a repo showing a basic usage with Require.js. |
Hi there,
I was wondering if anyone could provide me with some newbie instructions, or set me in the right direction using this library with requirejs.
I'm using your example as a main.js and getting an 'amdefine' not defined, if I comment out that if statement, I"m getting a 'define not defined' reference error.
Any help you can offer would be greatly appreciated, I'm just starting out in my first dev job so like I said I'm very much a coming to terms with some understanding JS concepts.
I've been trying this a couple of ways, one using amdefine as per http://requirejs.org/docs/node.html and the other using the define syntax as described under 'Usage' on https://github.com/shashwatak/satellite-js
Any help greatly appreciated
thanks
Duncan
var requirejs = require('requirejs');
if (typeof define !== 'function') {
var define = require('amdefine')(module,require);
}
define(function(require) {
var dep = require('dependency');
});
requirejs.config({
//Pass the top-level main.js/index.js require
// //function to requirejs so that node modules
// //are loaded relative to the top-level JS file.
baseUrl: __dirname,
nodeRequire: require,
});
module.exports = function () {};
// Sample TLE
var tleLine1 = '1 25544U 98067A 13149.87225694 .00009369 00000-0 16828-3 0 9031',
tleLine2 = '2 25544 051.6485 199.1576 0010128 012.7275 352.5669 15.50581403831869';
// Initialize a satellite record
define(['satellite.js/dist/satellite.min.js'], function(satellite) {
var satrec = satellite.twoline2satrec(tleLine1, tleLine2);
});
The text was updated successfully, but these errors were encountered: