<commit_before>define(['ol'],

    function (ol) {
        var source = new ol.source.Vector();
        var $scope;
        var $compile;
        var olus;
        var anything_collected = false;

        function entityClicked(entity) {
            $scope.showInfo(entity);
            if ($('#zone-info-dialog').length > 0) {
                angular.element('#zone-info-dialog').parent().remove();
            }
            var el = angular.element('<div hs.foodiezones.info-directive></div>');
            $("#hs-dialog-area").append(el);
            $compile(el)($scope);
        }

        source.cesiumStyler = function (dataSource) {
            var entities = dataSource.entities.values;
            for (var i = 0; i < entities.length; i++) {
                var entity = entities[i];
                styleEntity(entity);
            }
        }

        function styleEntity(entity) {
            entity.billboard.scaleByDistance = new Cesium.NearFarScalar(50, 1.5, 15000, 0.0);
            var picture = entity.properties.visited.getValue() ? 'viewpoint' : 'other';
            entity.billboard.image = entity.properties.start ? 'triangle-outline-64.png' : `../foodie-zones/symbols/${picture}.png`;
            entity.label = new Cesium.LabelGraphics({
                text: entity.properties.label,
                font: '14px Helvetica',
                fillColor: Cesium.Color.WHITE,
                outlineColor: new Cesium.Color(0.1, 0.1, 0.1, 0.9),
                outlineWidth: 2,
                showBackground: true,
                style: Cesium.LabelStyle.FILL_AND_OUTLINE,
                verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
                pixelOffset: new Cesium.Cartesian2(0, entity.properties.start ? -40 : -20),
                scaleByDistance: new Cesium.NearFarScalar(50, 1.5, 20000, 0.0),
                heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
            });
        }

        function stationExistsAtCoordinate(try_pnt, features) {
            var found_close = false;
            for (j = 0; j < features.length; j++) {
                var diff = { x: features[j].getGeometry().getCoordinates()[0] - try_pnt.x, y: features[j].getGeometry().getCoordinates()[1] - try_pnt.y };
                if (Math.sqrt(diff.x * diff.x + diff.y * diff.y) < 0.003) {
                    found_close = true;
                    break;
                }
            }
            return found_close
        }

        function getMapWidth() {
            return 0.052;
        }
        return {
            getMapWidth: getMapWidth,
            createStations: function (map, utils, c, callback) {
                var points_added = 0;
                source.clear();
                var features = [new ol.Feature({
                    geometry: new ol.geom.Point([c[0], c[1]]),
                    label: 'START / FINISH',
                    points: 0,
                    start: true,
                    visited: false<commit_msg>Rogaining. Some label styling for stations<commit_after>define(['ol'],

    function (ol) {
        var source = new ol.source.Vector();
        var $scope;
        var $compile;
        var olus;
        var anything_collected = false;

        function entityClicked(entity) {
            $scope.showInfo(entity);
            if ($('#zone-info-dialog').length > 0) {
                angular.element('#zone-info-dialog').parent().remove();
            }
            var el = angular.element('<div hs.foodiezones.info-directive></div>');
            $("#hs-dialog-area").append(el);
            $compile(el)($scope);
        }

        source.cesiumStyler = function (dataSource) {
            var entities = dataSource.entities.values;
            for (var i = 0; i < entities.length; i++) {
                var entity = entities[i];
                styleEntity(entity);
            }
        }

        function styleEntity(entity) {
            entity.billboard.scaleByDistance = new Cesium.NearFarScalar(50, 1.5, 20000, 0.0);
            var picture = entity.properties.visited.getValue() ? 'viewpoint' : 'other';
            entity.billboard.image = entity.properties.start ? 'triangle-outline-64.png' : `../foodie-zones/symbols/${picture}.png`;
            entity.label = new Cesium.LabelGraphics({
                text: entity.properties.label,
                font: '18px "Lato", sans-serif',
                fillColor: Cesium.Color.WHITE,
                outlineColor: new Cesium.Color(0.1, 0.1, 0.1, 0.9),
                outlineWidth: 2,
                showBackground: true,
                style: Cesium.LabelStyle.FILL_AND_OUTLINE,
                verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
                pixelOffset: new Cesium.Cartesian2(0, entity.properties.start ? -40 : -30),
                pixelOffsetScaleByDistance : new Cesium.NearFarScalar(50, 1.5, 20000, 0.0),
                scaleByDistance: new Cesium.NearFarScalar(50, 1.5, 20000, 0.0),
                heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
            });
        }

        function stationExistsAtCoordinate(try_pnt, features) {
            var found_close = false;
            for (j = 0; j < features.length; j++) {
                var diff = { x: features[j].getGeometry().getCoordinates()[0] - try_pnt.x, y: features[j].getGeometry().getCoordinates()[1] - try_pnt.y };
                if (Math.sqrt(diff.x * diff.x + diff.y * diff.y) < 0.003) {
                    found_close = true;
                    break;
                }
            }
            return found_close
        }

        function getMapWidth() {
            return 0.052;
        }
        return {
            getMapWidth: getMapWidth,
            createStations: function (map, utils, c, callback) {
                var points_added = 0;
                source.clear();
                var features = [new ol.Feature({
                    geometry: new ol.geom.Point([c[0], c[1]]),
                    label: 'START / FINISH',
                    points: 0,
                    start: true,
                    visited: false
{'fraction_non_alphanumeric': 0.12266009852216748, 'fraction_numerical': 0.020853858784893268, 'mean_word_length': 1.5798390512494707, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3083064', 'n_tokens_mistral': 1830, 'n_tokens_neox': 1670, 'n_words': 343}