<commit_before>/*
 * geoserve - <NAME> June 2013
 * http://redcapmedia.com
 */

Meteor.startup(function(){
    createMap();
    marker_sub = Meteor.subscribe("allMarkers");
    Deps.autorun(function(){
        if(marker_sub.ready()){
            groups_sub = Meteor.subscribe("allGroups"),
            marker_types_sub = Meteor.subscribe("allMarkerTypes"),
            services_sub = Meteor.subscribe("allServices");

            if(marker_types_sub.ready() && groups_sub.ready() && services_sub.ready()){
                // this sets the new loc prematurely?
                var curMarker = Session.get('selected_marker');
                if(curMarker){
                    // load marker services and all services - but also need to trigger this when creating a new record...
                   if(typeof marker_services_sub == 'undefined'){
                        marker_services_sub = Meteor.subscribe("allMarkerServices");
                        var q = markers.findOne({_id:curMarker}).loc;
                        setMapCenter(q);
                        lookForMarkers();
                    }else if(marker_services_sub.ready()){
                        console.log('cur marker set inside of autorun');
                        var q = markers.findOne({_id: curMarker});
                        if(q)
                            if(typeof q['loc'] != 'undefined')
                                setMapCenter(q['loc']);
                            else{
                                console.log('problem with mongo loc query');
                                setMapCenter([0,0]);
                            }
                        lookForMarkers();
                    }
                // probably show something that allows us to edit the selected marker?
                }else{
                    var mCheck = markers.find({},{}).fetch();
                    // maybe not 'create the map new each time?
                    if(typeof map === 'undefined' && !mCheck){
                        createMap();
                        setMapCenter([0,0]);
                    }else if (mCheck){
                        var emCheck = mCheck.pop();
                        if(typeof emCheck != 'undefined')
                            emCheck = emCheck['loc'];
                        else{
                            alert('It appears you are running geoserve for the first time!');
                            // ideally show the add marker screen
                            emCheck = [0,0];
                        }
                        setMapCenter(emCheck);
                    }else<commit_msg>fixed services inside of selected marker<commit_after>/*
 * geoserve - <NAME> June 2013
 * http://redcapmedia.com
 */

Meteor.startup(function(){
    createMap();
    marker_sub = Meteor.subscribe("allMarkers");
    Deps.autorun(function(){
        if(marker_sub.ready()){
            groups_sub = Meteor.subscribe("allGroups"),
            marker_types_sub = Meteor.subscribe("allMarkerTypes"),
            services_sub = Meteor.subscribe("allServices");
            marker_services_sub = Meteor.subscribe("allMarkerServices");
            if(marker_types_sub.ready() && groups_sub.ready() && services_sub.ready() && marker_services_sub.ready()){
                // this sets the new loc prematurely?
                var curMarker = Session.get('selected_marker');
                if(curMarker){
                    // load marker services and all services - but also need to trigger this when creating a new record...
                   
                    console.log('cur marker set inside of autorun');
                    var q = markers.findOne({_id: curMarker});
                    if(q)
                        if(typeof q['loc'] != 'undefined')
                            setMapCenter(q['loc']);
                        else{
                            console.log('problem with mongo loc query');
                            setMapCenter([0,0]);
                        }
                    lookForMarkers();
                
                // probably show something that allows us to edit the selected marker?
                }else{
                    var mCheck = markers.find({},{}).fetch();
                    // maybe not 'create the map new each time?
                    if(typeof map === 'undefined' && !mCheck){
                        createMap();
                        setMapCenter([0,0]);
                    }else if (mCheck){
                        var emCheck = mCheck.pop();
                        if(typeof emCheck != 'undefined')
                            emCheck = emCheck['loc'];
                        else{
                            alert('It appears you are running geoserve for the first time!');
                            // ideally show the add marker screen
                            emCheck = [0,0];
                        }
                        setMapCenter(emCheck);
                    }else
{'fraction_non_alphanumeric': 0.10229099678456592, 'fraction_numerical': 0.0040192926045016075, 'mean_word_length': 1.2159394479073908, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5962280', 'n_tokens_mistral': 1186, 'n_tokens_neox': 1097, 'n_words': 283}