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

Autolinker being added to global scope #3497

Closed
mramato opened this issue Feb 1, 2016 · 4 comments
Closed

Autolinker being added to global scope #3497

mramato opened this issue Feb 1, 2016 · 4 comments

Comments

@mramato
Copy link
Contributor

mramato commented Feb 1, 2016

Below is a modified version of HelloWorld.html that compares items in the global scope before and after the combined Cesium.js is loaded. This spits out 4 values

"Autolinker"
"Cesium"
"viewer"
"loadJsonp445142"

Cesium, viewer, and loadJsonp445142 are all expected, but Autolinker is being required in KmlDataSource.js and should not be setting a global. This is either a bug in Autolinker or something we are doing in correct. In either case, we should investigate and fix the issue.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <title>Hello World!</title>
    <script>
        function arr_diff(a1, a2) {
            var i, a = [], diff = [];
            for (i = 0; i < a1.length; i++) {
                a[a1[i]] = true;
            }
            for (i = 0; i < a2.length; i++) {
                if (a[a2[i]]) {
                    delete a[a2[i]];
                } else {
                    a[a2[i]] = true;
                }
            }
            for (var k in a) {
                diff.push(k);
            }
            return diff;
        }
        var original = Object.keys(window);
    </script>
    <script src="../Build/Cesium/Cesium.js"></script>
    <style>
        @import url(../Build/Cesium/Widgets/widgets.css);

        html, body, #cesiumContainer {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
            overflow: hidden;
        }
    </style>
</head>
<body>
<div id="cesiumContainer"></div>
<script>
    var viewer = new Cesium.Viewer('cesiumContainer');
    console.log(arr_diff(original, Object.keys(window)));
</script>
</body>
</html>
@mramato mramato added the cleanup label Feb 1, 2016
@theaverageguy
Copy link

I am taking this up.

@hpinkos
Copy link
Contributor

hpinkos commented Feb 19, 2016

Thanks @yash14123! Hopefully this will be an easy fix.
Just for reference, if you were looking for other issues to tackle, we have the beginner label for issues we think are good ones for new contributors.

@bampakoa
Copy link
Contributor

@mramato I think that this can be closed according to your comment #8034 (comment)

@mramato
Copy link
Contributor Author

mramato commented Oct 27, 2020

@bampakoa thanks, I confirmed that it is indeed fixed.

@mramato mramato closed this as completed Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment