{"action":"created","comment":{"url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/pulls/comments/74950056","id":74950056,"diff_hunk":"@@ -0,0 +1,746 @@\n+\"use strict\";\n+\n+// ======= constants =======\n+var TITLE = \"WABA Bike Infrastructure Map Project\";\n+var loopCount = 0;\n+\n+// ======= display =======\n+var defaultDisplay = {\n+    loopCount: 0,\n+    allRegions: false,\n+    regionsArray: [\"AL\", \"AR\", \"DC\", \"MO\", \"PG\"],\n+    bufferStyle: { \"fill\": \"#56B6DB\", \"stroke\": \"#1A3742\", \"stroke-width\": 2 },\n+\n+    // ======= toggleClearAll =======\n+    toggleClearAll: function() {\n+        console.log(\"toggleClearAll\");\n+        var clearFlag = false;\n+        $.each(app.state.selRegions, function(region, selected) {\n+            if (selected == true) { clearFlag = true; }\n+        });\n+        clearFlag ? $('#clearAll-r > p').text('clear') : $('#clearAll-r > p').text('all');\n+    }\n+};\n+\n+// ======= map =======\n+var defaultMap = {\n+    mapEl: document.getElementById(\"map\"),\n+    mapStyle: \"mapbox.light\",\n+    centerLat: 38.99,\n+    centerLng: -77.20,\n+    zoom: 11,\n+    zoomControl: false,\n+    dataLayers: [],\n+    markersGroup: [],\n+    markersSelected: []\n+}\n+\n+// ======= state =======\n+var defaultState = {\n+    selRegions: { AL: false, AR: false, DC: false, MO: false, PG: false },\n+    AL: {\n+        selLanes: { lanes:true, paths:false, trails:false },\n+        selBuffers: { ft500:false, ft1000:false, ft2500:false, ft5280:false },\n+        laneData:[],\n+        laneLayers:[],\n+        bufferLayers: { ft500:null, ft1000:null, ft2500:null, ft5280:null },\n+        bikeLaneStyle: { color: \"#004529\", weight: 2 },\n+        regionColor: \"#004529\"\n+    },\n+    AR: {\n+        selLanes: { lanes:true, paths:false, trails:false },\n+        selBuffers: { ft500:false, ft1000:false, ft2500:false, ft5280:false },\n+        laneData:[],\n+        laneLayers:[],\n+        bufferLayers: { ft500:null, ft1000:null, ft2500:null, ft5280:null },\n+        bikeLaneStyle: { color: \"#006837\", weight: 2 },\n+        regionColor: \"#006837\"\n+    },\n+    DC: {\n+        selLanes: { lanes:true, paths:true, trails:true },\n+        selBuffers: { ft500:false, ft1000:false, ft2500:false, ft5280:false },\n+        laneData:[],\n+        laneLayers:[],\n+        bufferLayers: { ft500:null, ft1000:null, ft2500:null, ft5280:null },\n+        bikeLaneStyle: { color: \"#238443\", weight: 2 },\n+        regionColor: \"#238443\"\n+    },\n+    MO: {\n+        selLanes: { lanes:true, paths:false, trails:false },\n+        selBuffers: { ft500:false, ft1000:false, ft2500:false, ft5280:false },\n+        laneData:[],\n+        laneLayers:[],\n+        bufferLayers: { ft500:null, ft1000:null, ft2500:null, ft5280:null },\n+        bikeLaneStyle: { color: \"#41ab5d\", weight: 2 },\n+        regionColor: \"#41ab5d\"\n+    },\n+    PG: {\n+        selLanes: { lanes:false, paths:false, trails:false },\n+        selBuffers: { ft500:false, ft1000:false, ft2500:false, ft5280:false },\n+        laneData:[],\n+        laneLayers:[],\n+        bufferLayers: { ft500:null, ft1000:null, ft2500:null, ft5280:null },\n+        bikeLaneStyle: { color: \"#78c679\", weight: 2 },\n+        regionColor: \"#78c679\"\n+    }\n+}\n+\n+// ======= regions =======\n+var regions = {\n+    AL: {\n+        id: \"AL_4\",\n+        name: \"Alexandria\",\n+        box: { NW: [null, null], SE: [null, null] },\n+        center: [null, null],\n+        zoneFiles: [],\n+        laneFiles: {\n+            lanes: \"VA_Alexandria_Bike.geojson\",\n+            paths: null,\n+            trails: null },\n+        bufferFiles: {\n+            ft500:\"VA_Alexandria_Bike_Buffer_500ft.geojson\",\n+            ft1000:\"VA_Alexandria_Bike_Buffer_1000ft.geojson\",\n+            ft2500:\"VA_Alexandria_Bike_Buffer_2500ft.geojson\",\n+            ft5280:\"VA_Alexandria_Bike_Buffer_5280ft.geojson\" }\n+    },\n+    AR: {\n+        id: \"AR_3\",\n+        name: \"Arlington\",\n+        box: { NW: [null, null], SE: [null, null] },\n+        center: [null, null],\n+        zoneFiles: [],\n+        laneFiles: {\n+            lanes: \"VA_Arlington_Bike.geojson\",\n+            paths: null,\n+            trails: null },\n+        bufferFiles: {\n+            ft500:\"VA_Arlington_Bike_Buffer_500ft.geojson\",\n+            ft1000:\"VA_Arlington_Bike_Buffer_1000ft.geojson\",\n+            ft2500:\"VA_Arlington_Bike_Buffer_2500ft.geojson\",\n+            ft5280:\"VA_Arlington_Bike_Buffer_5280ft.geojson\" }\n+    },\n+    DC: {\n+        id: \"DC_0\",\n+        name: \"District of Columbia\",\n+        box: { NW: [null, null], SE: [null, null] },\n+        center: [38.91, -77.04],\n+        zoneFiles: [\"District_Mask.geojson\", \"Ward__2012.geojson\"],\n+        laneFiles: {\n+            lanes: \"DC_Bike_Lanes.geojson\",\n+            paths: \"DC_Bike_Paths_All.geojson\",\n+            trails: \"DC_Bike_Trails.geojson\" },\n+        bufferFiles: {\n+            ft500: \"DC_Bike_Buffer_500ft.geojson\",\n+            ft1000: \"DC_Bike_Buffer_1000ft.geojson\",\n+            ft2500: \"DC_Bike_Buffer_2500ft.geojson\",\n+            ft5280: \"DC_Bike_Buffer_5280ft.geojson\" }\n+    },\n+    MO: {\n+        id: \"MO_1\",\n+        name: \"Montgomery County\",\n+        box: { NW: [null, null], SE: [null, null] },\n+        center: [null, null],\n+        zoneFiles: [],\n+        laneFiles: {\n+            lanes: \"MD_MontgomeryCounty_Bikeways.geojson\",\n+            paths: null,\n+            trails: null },\n+        bufferFiles: {\n+            ft500: \"MD_MontgomeryCounty_Bikeways_Buffer_500ft.geojson\",\n+            ft1000: \"MD_MontgomeryCounty_Bikeways_Buffer_1000ft.geojson\",\n+            ft2500: \"MD_MontgomeryCounty_Bikeways_Buffer_2500ft.geojson\",\n+            ft5280: \"MD_MontgomeryCounty_Bikeways_Buffer_5280ft.geojson\" }\n+    },\n+    PG: {\n+        id: \"PG_2\",\n+        name: \"Prince George's County\",\n+        box: { NW: [null, null], SE: [null, null] },\n+        center: [null, null],\n+        zoneFiles: [],\n+        laneFiles: { lanes:null, paths:null, trails:null },\n+        bufferFiles: { ft500:null, ft1000:null, ft2500:null, ft5280:null }\n+    },\n+}\n+\n+\n+// ======= app =======\n+var app;\n+// $(() => app.initialize());\n+app = {\n+    map: defaultMap,\n+    state: defaultState,\n+    display: defaultDisplay,\n+    geocoder: null,\n+    activeMap: null,\n+\n+    // ======= initialize =======\n+    initialize: function() {\n+        console.log(\"initialize\");\n+        app.activeMap = app.initMap();\n+        app.activateMap();\n+        app.activateMenu();\n+    },\n+\n+    // ======= activateMenu =======\n+    activateMenu: function() {\n+        console.log(\"activateMenu\");\n+\n+        $('.region, .buffer').on('click', function(e) {\n+            console.log(\"\\n-- click --\");\n+            event.stopPropagation();\n+            app.toggleFilterState(e.currentTarget);\n+            app.toggleFilterData(e.currentTarget);\n+        });\n+        $('#clearAll').on('click', function(e) {\n+            console.log(\"\\n-- click --\");\n+            event.stopPropagation();\n+            app.clearSelectAll(e.currentTarget);\n+        });\n+        $('.region, .buffer, .start, .end, #clearAll-r').on('mouseenter', function(e) {\n+            // console.log(\"-- over --\");\n+            event.stopPropagation();\n+            updateHoverText(e.currentTarget, \"enter\");\n+        });\n+        $('.region, .buffer, .start, .end, #clearAll-r').on('mouseleave', function(e) {\n+            // console.log(\"-- out --\");\n+            event.stopPropagation();\n+            updateHoverText(e.currentTarget, \"leave\");\n+        });\n+\n+        // ======= updateHoverText =======\n+        function updateHoverText(hoverEl, enterLeave) {\n+            // console.log(\"updateHoverText\");\n+            var hoverText;\n+            var region = $(hoverEl).parents().eq(1).attr('id');\n+            if (enterLeave == \"enter\") {\n+                if ($(hoverEl).hasClass('buffer')) {\n+                    if (app.state.selRegions[region]) {\n+                        $(hoverEl).addClass(\"entered\");\n+                        if ($(hoverEl).hasClass('ft500')) {\n+                            hoverText = \"500 ft buffer\";\n+                        } else if ($(hoverEl).hasClass('ft1000')) {\n+                            hoverText = \"1000 ft buffer\";\n+                        } else if ($(hoverEl).hasClass('ft2500')) {\n+                            hoverText = \"2500 ft buffer\";\n+                        } else if ($(hoverEl).hasClass('ft5280')) {\n+                            hoverText = \"1 mile buffer\";\n+                        }\n+                    }\n+                } else {\n+                    if ($(hoverEl).hasClass('region')) {\n+                        hoverText = regions[$(hoverEl).closest('tr').attr('id')].name;\n+                    } else if ($(hoverEl).hasClass('start')) {\n+                        hoverText = \"map click start loction\";\n+                    } else if ($(hoverEl).hasClass('end')) {\n+                        hoverText = \"map click end loction\";\n+                    } else if (($(hoverEl).attr('id') == 'clearAll-r') && ($(hoverEl).text() == 'all')) {\n+                        hoverText = \"select all regions\";\n+                    } else if (($(hoverEl).attr('id') == 'clearAll-r') && ($(hoverEl).text() == 'clear')) {\n+                        hoverText = \"clear all regions/buffers\";\n+                    }\n+                }\n+            } else {\n+                if ($(hoverEl).hasClass('buffer')) {\n+                    if (app.state.selRegions[region]) {\n+                        $(hoverEl).removeClass(\"entered\");\n+                    }\n+                }\n+                hoverText = \".\";\n+            }\n+            $(\"#hoverText\").text(hoverText);\n+        }\n+    },\n+\n+    // ======= toggleFilterState =======\n+    toggleFilterState: function(toggleEl) {\n+        console.log(\"toggleFilterState\");\n+        var region = $(toggleEl).parents().eq(1).attr('id');\n+        var buffer = null;\n+        console.log(\"  app.state.selRegions[region]1: \", app.state.selRegions[region]);\n+\n+        // == update region filter\n+        if ($(toggleEl).hasClass('region')) {\n+\n+            // == toggle region state\n+            app.state.selRegions[region] ?\n+                app.state.selRegions[region] = false :\n+                app.state.selRegions[region] = true;\n+\n+            // == update clear/all button text\n+            // console.log(\"  app.state.selRegions[region]2: \", app.state.selRegions[region]);\n+            // if (app.state.selRegions[region] == true) {\n+            //     console.log(\"TRUE\");\n+            //     console.log(\"  $('#clearAll-r > p').text(): \", $('#clearAll-r > p').text());\n+            //     $('#clearAll-r > p').text('clear');\n+            //     console.log(\"  $('#clearAll-r > p').text(): \", $('#clearAll-r > p').text());\n+            // } else {\n+            //     console.log(\"MISSED\");\n+            // }\n+\n+            // == toggle region element (and buffer elements if deselecting)\n+            app.state.selRegions[region] ?\n+                $(toggleEl).addClass('selected') :\n+                updateBufferState(toggleEl);\n+\n+            // == toggle buffer element visibility if selecting\n+            if (app.state.selRegions[region]) {\n+                var bufferEls = $(toggleEl).parents().eq(1).children();\n+                bufferEls.each(function(index, bufferEl) {\n+                    if ($(bufferEl).hasClass('td-b')) {\n+                        $(bufferEl).children().css('visibility', 'visible');\n+                    }\n+                })\n+            };\n+        };\n+\n+        // == identify selected buffer\n+        if ($(toggleEl).hasClass('ft500')) { buffer = 'ft500' };\n+        if ($(toggleEl).hasClass('ft1000')) { buffer = 'ft1000' };\n+        if ($(toggleEl).hasClass('ft2500')) { buffer = 'ft2500' };\n+        if ($(toggleEl).hasClass('ft5280')) { buffer = 'ft5280' };\n+\n+        // == update buffer filter\n+        if (buffer) {\n+            if (app.state.selRegions[region]) {\n+\n+                // == toggle buffer state\n+                app.state[region].selBuffers[buffer] ?\n+                    app.state[region].selBuffers[buffer] = false :\n+                    app.state[region].selBuffers[buffer] = true;\n+\n+                // == toggle buffer filter elements\n+                app.state[region].selBuffers[buffer] ?\n+                    $(toggleEl).addClass('selected') :\n+                    $(toggleEl).removeClass('selected');\n+            }\n+        }\n+\n+        // ======= updateBufferState =======\n+        function updateBufferState(toggleEl) {\n+            console.log(\"updateBufferState\");\n+\n+            // == deselect region filter element\n+            $(toggleEl).removeClass('selected');\n+\n+            // == deselect buffer filter elements for region\n+            var bufferEls = $(toggleEl).parents().eq(1).children();\n+            bufferEls.each(function(index, bufferEl) {\n+                if ($(bufferEl).hasClass('td-b')) {\n+                    $(bufferEl).children().removeClass('selected');\n+                    $(bufferEl).children().css('visibility', 'hidden');\n+                }\n+            });\n+            app.state[$(toggleEl).parents().eq(1).attr('id')].selBuffers.ft500 = false;\n+            app.state[$(toggleEl).parents().eq(1).attr('id')].selBuffers.ft1000 = false;\n+            app.state[$(toggleEl).parents().eq(1).attr('id')].selBuffers.ft2500 = false;\n+            app.state[$(toggleEl).parents().eq(1).attr('id')].selBuffers.ft5280 = false;\n+        }\n+\n+        // == update clear/all button text\n+        app.display.toggleClearAll();\n+    },\n+\n+    // ======= toggleFilterData =======\n+    toggleFilterData: function(toggleEl) {\n+        console.log(\"toggleFilterData\");\n+\n+        var laneFeatures = null;\n+        var bufferFeatures = null;\n+        var region = null;\n+        var buffer = null;\n+\n+        // == region filter selection\n+        if ($(toggleEl).hasClass('region')) {\n+            region = $(toggleEl).parents().eq(1).attr('id');\n+            if (app.state.selRegions[region] && (app.state[region].laneData.length == 0)) {\n+                app.state[region].laneData = app.makeLanesArray(region);\n+                if (app.state[region].laneData) {\n+                    var url = \"bikelanes/\" + app.state[region].laneData[0];\n+                    app.laneAjaxQueue(url, region, null);\n+                }\n+            } else {\n+                app.state[region].laneData = [];\n+                removeBufferLayers(region);\n+            }\n+        }\n+\n+        // == identift buffer selection\n+        if ($(toggleEl).hasClass('ft500')) { buffer = 'ft500' };\n+        if ($(toggleEl).hasClass('ft1000')) { buffer = 'ft1000' };\n+        if ($(toggleEl).hasClass('ft2500')) { buffer = 'ft2500' };\n+        if ($(toggleEl).hasClass('ft5280')) { buffer = 'ft5280' };\n+\n+        // == buffer filter selection\n+        if (buffer) {\n+            var selRegion = $(toggleEl).parents().eq(1).attr('id');\n+            app.state[selRegion].selBuffers[buffer] ?\n+                getBufferData(selRegion, buffer) :\n+                clearBufferData(selRegion, buffer);\n+\n+            // ======= getBufferData =======\n+            function getBufferData(region, buffer) {\n+                console.log(\"getBufferData\");\n+                var url = \"buffers/\" + regions[region].bufferFiles[buffer];\n+                app.bufferAjaxQueue(url, region, buffer);\n+            }\n+\n+            // ======= clearBufferData =======\n+            function clearBufferData(region, buffer) {\n+                console.log(\"clearBufferData\");\n+                var bufferFeature = app.state[region].bufferLayers[buffer];\n+                if (bufferFeature) {\n+                    app.activeMap.removeLayer(bufferFeature);\n+                }\n+                app.state[region].bufferLayers[buffer] = null;\n+            }\n+        }\n+\n+        // ======= removeBufferLayers =======\n+        function removeBufferLayers(region) {\n+            console.log(\"removeBufferLayers\");\n+            if (!app.state.selRegions[region]) {\n+                app.state[region].laneLayers.forEach(function (laneData) {\n+                    app.activeMap.removeLayer(laneData);\n+                })\n+                app.state[region].laneLayers = [];\n+                if (app.state[region].bufferLayers['ft500']) {\n+                    app.activeMap.removeLayer(app.state[region].bufferLayers['ft500']);\n+                    app.state[region].bufferLayers['ft500'] = null;\n+                }\n+                if (app.state[region].bufferLayers['ft1000']) {\n+                    app.activeMap.removeLayer(app.state[region].bufferLayers['ft1000']);\n+                    app.state[region].bufferLayers['ft1000'] = null;\n+                }\n+                if (app.state[region].bufferLayers['ft2500']) {\n+                    app.activeMap.removeLayer(app.state[region].bufferLayers['ft2500']);\n+                    app.state[region].bufferLayers['ft2500'] = null;\n+                }\n+                if (app.state[region].bufferLayers['ft5280']) {\n+                    app.activeMap.removeLayer(app.state[region].bufferLayers['ft5280']);\n+                    app.state[region].bufferLayers['ft5280'] = null;\n+                }\n+            }\n+        }\n+    },\n+\n+    // ======= makeLanesArray =======\n+    makeLanesArray: function(region) {\n+        console.log(\"makeLanesArray\");\n+        var pathDataArray = [];\n+        if (regions[region].laneFiles.lanes) {\n+            var laneFile = regions[region].laneFiles.lanes;\n+            laneFile ? pathDataArray.push(laneFile) : console.log(\"NO LANES\");\n+        }\n+        if (regions[region].laneFiles.paths) {\n+            var pathFile = regions[region].laneFiles.paths;\n+            pathFile ? pathDataArray.push(pathFile) : console.log(\"NO PATHS\");\n+        }\n+        if (regions[region].laneFiles.trails) {\n+            var trailFile = regions[region].laneFiles.trails;\n+            trailFile ? pathDataArray.push(trailFile) : console.log(\"NO TRAILS\");\n+        }\n+        return pathDataArray;       // array of lane/path/trail geojson files\n+    },\n+\n+    // ======= clearSelectAll =======\n+    clearSelectAll: function(toggleEl) {\n+        console.log(\"clearSelectAll\");\n+\n+        // == select or clear all regions\n+        var clearFlag = false;\n+        $.each(app.state.selRegions, function(region, selected) {\n+            if (selected == true) {\n+                clearFlag = true;\n+            }\n+        });\n+        console.log(\"  clearFlag: \", clearFlag);\n+        clearFlag ? clearAll() : selectAll();\n+\n+        // ======= selectAll =======\n+        function selectAll() {\n+            console.log(\"selectAll\");\n+\n+            // == show buffer elements\n+            var bufferEls = $('.td-b').children('.buffer');\n+            bufferEls.each(function(index, bufferEl) {\n+                $(bufferEl).css('visibility', 'visible');\n+            });\n+\n+            app.display.allRegions = true;\n+\n+            // == update clear/all button text\n+            $('#clearAll-r > p').text('clear');\n+\n+            // == select all region elements\n+            var regionEls = $('div.region');\n+            $(regionEls).each(function(index, regionEl) {\n+                if (!$(regionEl).hasClass('selected')) { $(regionEl).addClass('selected') };\n+            });\n+\n+            // == set selected state for all regions\n+            $.each(app.state.selRegions, function(region, selected) {\n+                if (!selected) {\n+                    app.state.selRegions[region] = true;\n+                }\n+                app.state[region].laneData = app.makeLanesArray(region);\n+            });\n+            var url = \"bikelanes/\" + regions[app.display.regionsArray[0]].laneFiles.lanes;\n+            app.laneAjaxQueue(url, app.display.regionsArray[0]);\n+            console.log(\"  app.state: \", app.state);\n+        }\n+\n+        // ======= clearAll =======\n+        function clearAll() {\n+            console.log(\"clearAll\");\n+\n+            // == update clear/all button text\n+            $('#clearAll-r > p').text('all');\n+\n+            // == hide buffer elements\n+            var bufferEls = $('.td-b').children('.buffer');\n+            bufferEls.each(function(index, bufferEl) {\n+                $(bufferEl).css('visibility', 'hidden');\n+            });\n+\n+            // == update region elements\n+            var regionEls = $('div.region');\n+            $(regionEls).each(function(index, regionEl) {\n+                if ($(regionEl).hasClass('selected')) { $(regionEl).removeClass('selected') };\n+            });\n+\n+            // == update buffer elements\n+            var bufferEls = $('div.buffer');\n+            $(bufferEls).each(function(index, bufferEl) {\n+                if ($(bufferEl).hasClass('selected')) { $(bufferEl).removeClass('selected') };\n+                if ($(bufferEl).hasClass('td-b')) {\n+                    $(bufferEl).children().css('visibility', 'hidden');\n+                }\n+            });\n+\n+            // == clear lane and buffer states and data layers\n+            $.each(app.state.selRegions, function(region, selected) {\n+                if (selected) {\n+                    app.state.selRegions[region] = false;\n+                    app.state[region].laneLayers.forEach(function (laneData) {\n+                        app.activeMap.removeLayer(laneData);\n+                    })\n+                    app.state[region].laneData = [];\n+                    app.state[region].laneLayers = [];\n+                    $.each(app.state[region].selBuffers, function(buffer, state) {\n+                        buffer = false;\n+                    });\n+                    $.each(app.state[region].bufferLayers, function(buffer, bufferData) {\n+                        if (bufferData) {\n+                            app.activeMap.removeLayer(bufferData);\n+                            bufferData = null;\n+                        }\n+                    });\n+                }\n+            });\n+\n+            // == restore regions array\n+            app.display.regionsArray = [\"AL\", \"AR\", \"DC\", \"MO\", \"PG\"];\n+            console.log(\"  app.state: \", app.state);\n+        }\n+    },\n+\n+    // ======= laneAjaxQueue =======\n+    laneAjaxQueue: function(url, region) {\n+        console.log(\"laneAjaxQueue\");\n+        var laneData = null;\n+\n+        $.ajax({\n+            url: url,\n+            method: \"GET\",\n+            dataType: \"text\"\n+        }).done(function(jsonData){\n+            console.log(\"*** ajax success ***\");\n+            var jsonData2 = $.parseJSON(jsonData);\n+            var laneFeatures = L.mapbox.featureLayer(jsonData2).addTo(app.activeMap);\n+            app.state[region].laneLayers.push(laneFeatures);\n+            laneFeatures.setStyle(app.state[region].bikeLaneStyle);\n+            if ((app.display.loopCount < app.state[region].laneData.length - 1) && (app.state[region].laneData.length != 1)) {\n+                console.log(\"multiple files\");\n+                app.display.loopCount++;\n+                laneData = app.state[region].laneData[app.display.loopCount];\n+                url = \"bikelanes/\" + laneData;\n+                app.laneAjaxQueue(url, region);\n+            } else {\n+                console.log(\"single file\");\n+                app.display.loopCount = 0;\n+                if (app.display.allRegions) {\n+                    if (app.display.regionsArray.length > 0) {\n+                        region = app.display.regionsArray[0];\n+                        laneData = app.state[region].laneData[app.display.loopCount];\n+                        app.display.regionsArray.shift();\n+                        if (laneData) {\n+                            url = \"bikelanes/\" + laneData;\n+                            app.laneAjaxQueue(url, region);\n+                        } else {\n+                            console.log(\"=== ALERT: Missing data for\", region);\n+                        }\n+                    } else {\n+                        app.display.regionsArray = [\"AL\", \"AR\", \"DC\", \"MO\", \"PG\"];\n+                    }\n+                }\n+            }\n+        }).fail(function(){\n+            console.log(\"*** ajax fail T ***\");\n+        });\n+    },\n+\n+    // ======= bufferAjaxQueue =======\n+    bufferAjaxQueue: function(url, region, buffer) {\n+        console.log(\"bufferAjaxQueue\");\n+        $.ajax({\n+            url: url,\n+            method: \"GET\",\n+            dataType: \"text\"\n+        }).done(function(jsonData){\n+            console.log(\"*** ajax success ***\");\n+            var jsonData2 = $.parseJSON(jsonData);\n+            var bufferFeatures = L.mapbox.featureLayer(jsonData2).addTo(app.activeMap);\n+            app.state[region].bufferLayers[buffer] = bufferFeatures;\n+            bufferFeatures.setStyle(app.display.bufferStyle);\n+        }).fail(function(){\n+            console.log(\"*** ajax fail T ***\");\n+        });\n+    },\n+\n+    // ======= allLanesQueue =======\n+    allLanesQueue: function(url, regionsArray) {\n+        console.log(\"allLanesQueue\");\n+        if ((Array.isArray(regionsArray)) && (regionsArray.length > 0)) {\n+            var region = regionsArray[0];\n+        } else {\n+            var region = regionsArray;\n+        }\n+\n+        $.ajax({\n+            url: url,\n+            method: \"GET\",\n+            dataType: \"text\"\n+        }).done(function(jsonData){\n+            console.log(\"*** ajax success ***\");\n+            var jsonData2 = $.parseJSON(jsonData);\n+            var laneFeatures = L.mapbox.featureLayer(jsonData2).addTo(app.activeMap);\n+            app.state[region].laneLayers.push(laneFeatures);\n+            laneFeatures.setStyle(app.state[region].bikeLaneStyle);\n+            if (loopCount < app.state[region].laneData.length - 1) {\n+                loopCount++;\n+                var laneData = app.state[region].laneData[loopCount];\n+                app.allLanesQueue(url, region);\n+            } else {\n+                var arrayR = app.display.regionsArray;\n+                arrayR.shift();\n+                app.display.regionsArray = arrayR;\n+                app.allLanesQueue(url, arrayR);\n+            }\n+        }).fail(function(){\n+            console.log(\"*** ajax fail T ***\");\n+        });\n+    },\n+\n+    // ======= initMap =======\n+    initMap: function () {\n+        console.log(\"app.initMap\");\n+        L.mapbox.accessToken = \"pk.eyJ1IjoiYWx1bHNoIiwiYSI6ImY0NDBjYTQ1NjU4OGJmMDFiMWQ1Y2RmYjRlMGI1ZjIzIn0.pngboKEPsfuC4j54XDT3VA\";\n+        var map = L.mapbox.map(\n+            app.map.mapEl,\n+            app.map.mapStyle,\n+            { zoomControl: false })\n+                .setView([app.map.centerLat, app.map.centerLng], app.map.zoom);\n+        new L.Control.Zoom({ position: \"bottomright\" }).addTo(map);\n+        return map;\n+    },\n+\n+    // ======= activateMap =======\n+    activateMap: function() {\n+        console.log(\"activateMap\");\n+\n+        // ======= mouse location =======\n+        app.activeMap.on(\"mousemove\", function (e) {\n+            document.getElementById(\"lat\").innerHTML = (e.latlng.lat).toFixed(4);\n+            document.getElementById(\"lng\").innerHTML = (e.latlng.lng).toFixed(4);\n+        });\n+\n+        // ======= mouse location =======\n+        app.activeMap.on(\"click\", function (e) {\n+            console.log(\"\\n-- mapClick -- \");","path":"script.js","position":669,"original_position":669,"commit_id":"8f4c891672ae90480e50291e60b754158474ced9","original_commit_id":"8f4c891672ae90480e50291e60b754158474ced9","user":{"login":"alulsh","id":10409657,"avatar_url":"https://avatars.githubusercontent.com/u/10409657?v=3","gravatar_id":"","url":"https://api.github.com/users/alulsh","html_url":"https://github.com/alulsh","followers_url":"https://api.github.com/users/alulsh/followers","following_url":"https://api.github.com/users/alulsh/following{/other_user}","gists_url":"https://api.github.com/users/alulsh/gists{/gist_id}","starred_url":"https://api.github.com/users/alulsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alulsh/subscriptions","organizations_url":"https://api.github.com/users/alulsh/orgs","repos_url":"https://api.github.com/users/alulsh/repos","events_url":"https://api.github.com/users/alulsh/events{/privacy}","received_events_url":"https://api.github.com/users/alulsh/received_events","type":"User","site_admin":false},"body":"Remove `console.log`","created_at":"2016-08-16T14:49:14Z","updated_at":"2016-08-16T14:49:14Z","html_url":"https://github.com/dcfemtech/hackforgood-waba-map/pull/78#discussion_r74950056","pull_request_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/pulls/78","_links":{"self":{"href":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/pulls/comments/74950056"},"html":{"href":"https://github.com/dcfemtech/hackforgood-waba-map/pull/78#discussion_r74950056"},"pull_request":{"href":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/pulls/78"}}},"pull_request":{"url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/pulls/78","id":81458227,"html_url":"https://github.com/dcfemtech/hackforgood-waba-map/pull/78","diff_url":"https://github.com/dcfemtech/hackforgood-waba-map/pull/78.diff","patch_url":"https://github.com/dcfemtech/hackforgood-waba-map/pull/78.patch","issue_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/issues/78","number":78,"state":"open","locked":false,"title":"added branch merge-toms-work and new UI files","user":{"login":"tomBeach","id":10157094,"avatar_url":"https://avatars.githubusercontent.com/u/10157094?v=3","gravatar_id":"","url":"https://api.github.com/users/tomBeach","html_url":"https://github.com/tomBeach","followers_url":"https://api.github.com/users/tomBeach/followers","following_url":"https://api.github.com/users/tomBeach/following{/other_user}","gists_url":"https://api.github.com/users/tomBeach/gists{/gist_id}","starred_url":"https://api.github.com/users/tomBeach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomBeach/subscriptions","organizations_url":"https://api.github.com/users/tomBeach/orgs","repos_url":"https://api.github.com/users/tomBeach/repos","events_url":"https://api.github.com/users/tomBeach/events{/privacy}","received_events_url":"https://api.github.com/users/tomBeach/received_events","type":"User","site_admin":false},"body":"Added this branch and new files: index.html (replaces existing), script.js, css/styles.css.","created_at":"2016-08-16T11:50:47Z","updated_at":"2016-08-16T14:49:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"91bf39011cdd6f8f1a47198f575701a39bb321e9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/pulls/78/commits","review_comments_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/pulls/78/comments","review_comment_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/issues/78/comments","statuses_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/statuses/8f4c891672ae90480e50291e60b754158474ced9","head":{"label":"dcfemtech:merge-toms-work","ref":"merge-toms-work","sha":"8f4c891672ae90480e50291e60b754158474ced9","user":{"login":"dcfemtech","id":7329613,"avatar_url":"https://avatars.githubusercontent.com/u/7329613?v=3","gravatar_id":"","url":"https://api.github.com/users/dcfemtech","html_url":"https://github.com/dcfemtech","followers_url":"https://api.github.com/users/dcfemtech/followers","following_url":"https://api.github.com/users/dcfemtech/following{/other_user}","gists_url":"https://api.github.com/users/dcfemtech/gists{/gist_id}","starred_url":"https://api.github.com/users/dcfemtech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcfemtech/subscriptions","organizations_url":"https://api.github.com/users/dcfemtech/orgs","repos_url":"https://api.github.com/users/dcfemtech/repos","events_url":"https://api.github.com/users/dcfemtech/events{/privacy}","received_events_url":"https://api.github.com/users/dcfemtech/received_events","type":"Organization","site_admin":false},"repo":{"id":61846251,"name":"hackforgood-waba-map","full_name":"dcfemtech/hackforgood-waba-map","owner":{"login":"dcfemtech","id":7329613,"avatar_url":"https://avatars.githubusercontent.com/u/7329613?v=3","gravatar_id":"","url":"https://api.github.com/users/dcfemtech","html_url":"https://github.com/dcfemtech","followers_url":"https://api.github.com/users/dcfemtech/followers","following_url":"https://api.github.com/users/dcfemtech/following{/other_user}","gists_url":"https://api.github.com/users/dcfemtech/gists{/gist_id}","starred_url":"https://api.github.com/users/dcfemtech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcfemtech/subscriptions","organizations_url":"https://api.github.com/users/dcfemtech/orgs","repos_url":"https://api.github.com/users/dcfemtech/repos","events_url":"https://api.github.com/users/dcfemtech/events{/privacy}","received_events_url":"https://api.github.com/users/dcfemtech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dcfemtech/hackforgood-waba-map","description":"DCFemTech Hack for Good 2016 - WABA Bike Map Project","fork":false,"url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map","forks_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/forks","keys_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/teams","hooks_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/hooks","issue_events_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/issues/events{/number}","events_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/events","assignees_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/assignees{/user}","branches_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/branches{/branch}","tags_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/tags","blobs_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/git/refs{/sha}","trees_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/statuses/{sha}","languages_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/languages","stargazers_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/stargazers","contributors_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/contributors","subscribers_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/subscribers","subscription_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/subscription","commits_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/commits{/sha}","git_commits_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/git/commits{/sha}","comments_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/comments{/number}","issue_comment_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/issues/comments{/number}","contents_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/contents/{+path}","compare_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/merges","archive_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/downloads","issues_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/issues{/number}","pulls_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/pulls{/number}","milestones_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/milestones{/number}","notifications_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/labels{/name}","releases_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/releases{/id}","deployments_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/deployments","created_at":"2016-06-24T00:52:18Z","updated_at":"2016-07-20T00:21:31Z","pushed_at":"2016-08-16T13:36:13Z","git_url":"git://github.com/dcfemtech/hackforgood-waba-map.git","ssh_url":"git@github.com:dcfemtech/hackforgood-waba-map.git","clone_url":"https://github.com/dcfemtech/hackforgood-waba-map.git","svn_url":"https://github.com/dcfemtech/hackforgood-waba-map","homepage":null,"size":14715,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":8,"mirror_url":null,"open_issues_count":31,"forks":8,"open_issues":31,"watchers":3,"default_branch":"master"}},"base":{"label":"dcfemtech:master","ref":"master","sha":"77925f5f0a47840dfb0663b2d78b1dbd65d0d0f0","user":{"login":"dcfemtech","id":7329613,"avatar_url":"https://avatars.githubusercontent.com/u/7329613?v=3","gravatar_id":"","url":"https://api.github.com/users/dcfemtech","html_url":"https://github.com/dcfemtech","followers_url":"https://api.github.com/users/dcfemtech/followers","following_url":"https://api.github.com/users/dcfemtech/following{/other_user}","gists_url":"https://api.github.com/users/dcfemtech/gists{/gist_id}","starred_url":"https://api.github.com/users/dcfemtech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcfemtech/subscriptions","organizations_url":"https://api.github.com/users/dcfemtech/orgs","repos_url":"https://api.github.com/users/dcfemtech/repos","events_url":"https://api.github.com/users/dcfemtech/events{/privacy}","received_events_url":"https://api.github.com/users/dcfemtech/received_events","type":"Organization","site_admin":false},"repo":{"id":61846251,"name":"hackforgood-waba-map","full_name":"dcfemtech/hackforgood-waba-map","owner":{"login":"dcfemtech","id":7329613,"avatar_url":"https://avatars.githubusercontent.com/u/7329613?v=3","gravatar_id":"","url":"https://api.github.com/users/dcfemtech","html_url":"https://github.com/dcfemtech","followers_url":"https://api.github.com/users/dcfemtech/followers","following_url":"https://api.github.com/users/dcfemtech/following{/other_user}","gists_url":"https://api.github.com/users/dcfemtech/gists{/gist_id}","starred_url":"https://api.github.com/users/dcfemtech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcfemtech/subscriptions","organizations_url":"https://api.github.com/users/dcfemtech/orgs","repos_url":"https://api.github.com/users/dcfemtech/repos","events_url":"https://api.github.com/users/dcfemtech/events{/privacy}","received_events_url":"https://api.github.com/users/dcfemtech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dcfemtech/hackforgood-waba-map","description":"DCFemTech Hack for Good 2016 - WABA Bike Map Project","fork":false,"url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map","forks_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/forks","keys_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/teams","hooks_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/hooks","issue_events_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/issues/events{/number}","events_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/events","assignees_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/assignees{/user}","branches_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/branches{/branch}","tags_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/tags","blobs_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/git/refs{/sha}","trees_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/statuses/{sha}","languages_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/languages","stargazers_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/stargazers","contributors_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/contributors","subscribers_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/subscribers","subscription_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/subscription","commits_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/commits{/sha}","git_commits_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/git/commits{/sha}","comments_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/comments{/number}","issue_comment_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/issues/comments{/number}","contents_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/contents/{+path}","compare_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/merges","archive_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/downloads","issues_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/issues{/number}","pulls_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/pulls{/number}","milestones_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/milestones{/number}","notifications_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/labels{/name}","releases_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/releases{/id}","deployments_url":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/deployments","created_at":"2016-06-24T00:52:18Z","updated_at":"2016-07-20T00:21:31Z","pushed_at":"2016-08-16T13:36:13Z","git_url":"git://github.com/dcfemtech/hackforgood-waba-map.git","ssh_url":"git@github.com:dcfemtech/hackforgood-waba-map.git","clone_url":"https://github.com/dcfemtech/hackforgood-waba-map.git","svn_url":"https://github.com/dcfemtech/hackforgood-waba-map","homepage":null,"size":14715,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":8,"mirror_url":null,"open_issues_count":31,"forks":8,"open_issues":31,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/pulls/78"},"html":{"href":"https://github.com/dcfemtech/hackforgood-waba-map/pull/78"},"issue":{"href":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/issues/78"},"comments":{"href":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/issues/78/comments"},"review_comments":{"href":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/pulls/78/comments"},"review_comment":{"href":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/pulls/78/commits"},"statuses":{"href":"https://api.github.com/repos/dcfemtech/hackforgood-waba-map/statuses/8f4c891672ae90480e50291e60b754158474ced9"}}}}
{"actor":{"display_login":"alulsh"}}