- Data Central
- 2020 Decennial Census
Select an Area
2020 Decennial Census
Detail
Diversity Index *
2020 | 2010 | Change |
---|---|---|
54 | 43 | 11 |
* The USA TODAY diversity index shows on a scale of 0 to 100 how likely it is two people from an area would have a different race or ethnicity. A score of 0 would mean everyone had the same race and ethnicity; a score of 100 would mean everyone in an area had a distinctly different combination of race and ethnicity. Nearly everywhere is some place in the middle. The index was invented in 1991 by Phil Meyer of the University of North Carolina and Shawn McIntosh, who was then with USA TODAY. This score differs from the Census Bureau's version of the diversity index because of differences in how the bureau's formula counts race and Hispanic origin.
Population by Race/Ethnicity
2020 | 2010 | Change | ||||
---|---|---|---|---|---|---|
# | % | # | % | |||
Total | 98,584 | 96,317 | 2.4% | |||
Race | White | 69,485 | 70.5% | 74,055 | 76.9% | -6.2% |
Black | 14,087 | 14.3% | 13,640 | 14.2% | 3.3% | |
American Indian | 698 | 0.7% | 344 | 0.4% | 102.9% | |
Asian | 1,289 | 1.3% | 1,253 | 1.3% | 2.9% | |
Pacific Islander | 24 | 0.0% | 116 | 0.1% | -79.3% | |
Other | 5,790 | 5.9% | 5,110 | 5.3% | 13.3% | |
Two or More | 7,211 | 7.3% | 1,799 | 1.9% | 300.8% | |
Ethnicity | Hispanic or Latino | 11,466 | 11.6% | 8,987 | 9.3% | 27.6% |
Population by Race/Ethnicity: 18 Years and Over
2020 | 2010 | Change | ||||
---|---|---|---|---|---|---|
# | % | # | % | |||
Total | 76,295 | 72,872 | 4.7% | |||
Race | White | 56,166 | 73.6% | 58,048 | 79.7% | -3.2% |
Black | 10,411 | 13.6% | 9,719 | 13.3% | 7.1% | |
American Indian | 470 | 0.6% | 233 | 0.3% | 101.7% | |
Asian | 1,028 | 1.3% | 929 | 1.3% | 10.7% | |
Pacific Islander | 11 | 0.0% | 75 | 0.1% | -85.3% | |
Other | 3,675 | 4.8% | 3,069 | 4.2% | 19.7% | |
Two or More | 4,534 | 5.9% | 799 | 1.1% | 467.5% | |
Ethnicity | Hispanic or Latino | 7,167 | 9.4% | 5,376 | 7.4% | 33.3% |
Diversity Index *
2020 | 2010 | Change |
---|---|---|
54 | 43 | 11 |
* The USA TODAY diversity index shows on a scale of 0 to 100 how likely it is two people from an area would have a different race or ethnicity. A score of 0 would mean everyone had the same race and ethnicity; a score of 100 would mean everyone in an area had a distinctly different combination of race and ethnicity. Nearly everywhere is some place in the middle. The index was invented in 1991 by Phil Meyer of the University of North Carolina and Shawn McIntosh, who was then with USA TODAY. This score differs from the Census Bureau's version of the diversity index because of differences in how the bureau's formula counts race and Hispanic origin.
Housing Units
2020 | 2010 | Change | |||
---|---|---|---|---|---|
# | % | # | % | ||
Total Housing Units | 40,475 | 40,551 | -0.2% | ||
Occupied | 36,883 | 91.1% | 35,930 | 88.6% | 2.7% |
Vacant | 3,592 | 8.9% | 4,621 | 11.4% | -22.3% |
Population in Group Quarters
2020 | |
---|---|
Total Population in Group Quarters | 4,424 |
Institutionalized Population | 1,823 |
Correctional Facilities for Adults | 1,079 |
Juvenile Facilities | 107 |
Nursing Facilities/Skilled-nursing Facilities | 637 |
Other Institutional Facilities | 0 |
Noninstitutionalized Population | 2,601 |
College/University Student Housing | 2,194 |
Military Quarters | 0 |
Other Noninstitutional Facilities | 407 |
Map
Total Population Change
Less than -3%
-3% to 0%
0% to 3%
3% to 6%
6% to 9%
9% to 12%
12% to 15%
15% to 18%
More than 18%
N/A
1:500,000 scale
Other Areas in Floyd County, Georgia
Total Population | Age 18 and Over | ||||||
Total Population | Age 18 and Over | ||||||
Area | Diversity Index | Total Population | Hispanic | Not Hispanic, White | Total Population | Hispanic | Not Hispanic, White |
---|---|---|---|---|---|---|---|
010 United States | 67 12 | 331,449,281 7.4% | 62,080,044 18.7% 23.0% | 191,697,647 57.8% -2.6% | 258,343,281 8.8% | 43,322,792 16.8% 19.9% | 157,118,573 60.8% 0.0% |
040-13 Georgia | 67 8 | 10,711,908 10.6% | 1,123,457 10.5% 31.6% | 5,362,156 50.1% -1.0% | 8,220,274 14.2% | 742,918 9.0% 38.0% | 4,342,333 52.8% 2.4% |
050-13115 Floyd County, Georgia | 54 11 | 98,584 2.4% | 11,466 11.6% 27.6% | 67,747 68.7% -4.5% | 76,295 4.7% | 7,167 9.4% 33.3% | 55,088 72.2% -1.9% |
140-13115000100 Census Tract 1, Floyd County, Georgia | 23 11 | 4,579 0.2% | 169 3.7% 79.8% | 4,061 88.7% -5.2% | 3,641 4.1% | 115 3.2% 101.8% | 3,286 90.2% -0.7% |
140-13115000202 Census Tract 2.02, Floyd County, Georgia | 16 5 | 3,956 -2.0% | 82 2.1% 2.5% | 3,635 91.9% -4.4% | 3,208 3.8% | 65 2.0% 51.2% | 2,964 92.4% 0.6% |
140-13115000203 Census Tract 2.03, Floyd County, Georgia | 36 12 | 3,116 10.1% | 95 3.0% 90.0% | 2,494 80.0% 1.2% | 2,394 14.8% | 78 3.3% 129.4% | 1,952 81.5% 6.1% |
140-13115000204 Census Tract 2.04, Floyd County, Georgia | 34 10 | 3,899 8.5% | 203 5.2% 36.2% | 3,193 81.9% 1.7% | 3,009 13.4% | 136 4.5% 63.9% | 2,514 83.5% 5.9% |
140-13115000300 Census Tract 3, Floyd County, Georgia | 29 -2 | 2,728 -2.4% | 150 5.5% -20.2% | 2,247 82.4% -2.4% | 2,520 5.2% | 139 5.5% 12.1% | 2,074 82.3% 1.7% |
140-13115000401 Census Tract 4.01, Floyd County, Georgia | 64 15 | 2,595 7.3% | 463 17.8% 34.2% | 1,563 60.2% -6.7% | 1,972 4.5% | 308 15.6% 48.1% | 1,274 64.6% -9.8% |
140-13115000402 Census Tract 4.02, Floyd County, Georgia | 47 14 | 1,389 2.9% | 119 8.6% 35.2% | 1,020 73.4% -7.1% | 1,150 3.9% | 80 7.0% 35.6% | 883 76.8% -4.6% |
140-13115000403 Census Tract 4.03, Floyd County, Georgia | 78 13 | 4,083 4.2% | 1,219 29.9% 28.0% | 1,787 43.8% -14.9% | 2,937 7.1% | 770 26.2% 41.5% | 1,430 48.7% -14.5% |
140-13115000500 Census Tract 5, Floyd County, Georgia | 84 14 | 3,740 2.1% | 1,533 41.0% 40.5% | 1,316 35.2% -19.9% | 2,546 -2.7% | 896 35.2% 32.5% | 1,069 42.0% -21.7% |
140-13115000600 Census Tract 6, Floyd County, Georgia | 65 5 | 4,549 -9.2% | 378 8.3% -2.1% | 1,922 42.3% -7.4% | 3,478 -10.3% | 248 7.1% -4.6% | 1,616 46.5% -9.0% |
140-13115000700 Census Tract 7, Floyd County, Georgia | 22 7 | 5,173 1.4% | 185 3.6% 58.1% | 4,621 89.3% -2.1% | 4,032 5.7% | 111 2.8% 58.6% | 3,648 90.5% 2.4% |
140-13115000800 Census Tract 8, Floyd County, Georgia | 43 7 | 4,906 5.3% | 180 3.7% 66.7% | 3,677 74.9% 1.3% | 3,934 7.5% | 111 2.8% 70.8% | 3,003 76.3% 2.2% |
140-13115000900 Census Tract 9, Floyd County, Georgia | 40 5 | 2,336 2.8% | 77 3.3% 54.0% | 1,789 76.6% -1.2% | 1,770 6.5% | 49 2.8% 81.5% | 1,419 80.2% 1.6% |
140-13115001100 Census Tract 11, Floyd County, Georgia | 72 9 | 2,749 -1.2% | 615 22.4% 17.4% | 1,300 47.3% -13.4% | 2,205 -2.9% | 385 17.5% 12.2% | 1,159 52.6% -15.5% |
140-13115001200 Census Tract 12, Floyd County, Georgia | 81 12 | 5,596 19.6% | 1,900 34.0% 32.2% | 2,339 41.8% 6.5% | 4,111 26.0% | 1,130 27.5% 35.3% | 1,979 48.1% 15.3% |
140-13115001301 Census Tract 13.01, Floyd County, Georgia | 79 15 | 2,760 11.6% | 959 34.7% 20.8% | 1,296 47.0% -0.8% | 1,948 14.3% | 587 30.1% 30.7% | 1,041 53.4% 2.1% |
140-13115001302 Census Tract 13.02, Floyd County, Georgia | 67 22 | 3,775 4.4% | 630 16.7% 48.2% | 2,141 56.7% -17.7% | 2,839 6.9% | 417 14.7% 65.5% | 1,758 61.9% -14.6% |
140-13115001400 Census Tract 14, Floyd County, Georgia | 41 17 | 6,408 1.0% | 652 10.2% 90.6% | 5,088 79.4% -8.2% | 4,844 -1.1% | 347 7.2% 87.6% | 4,007 82.7% -8.7% |
140-13115001600 Census Tract 16, Floyd County, Georgia | 66 6 | 3,232 -8.6% | 390 12.1% 0.3% | 1,060 32.8% -12.7% | 2,358 -7.9% | 256 10.9% 8.0% | 880 37.3% -11.9% |
140-13115001703 Census Tract 17.03, Floyd County, Georgia | 24 11 | 3,427 -1.6% | 125 3.6% 28.9% | 3,021 88.2% -7.1% | 2,695 1.4% | 82 3.0% 43.9% | 2,402 89.1% -4.3% |
140-13115001704 Census Tract 17.04, Floyd County, Georgia | 16 8 | 2,900 -3.3% | 73 2.5% 49.0% | 2,679 92.4% -6.8% | 2,309 1.7% | 35 1.5% 20.7% | 2,169 93.9% -1.1% |
140-13115001705 Census Tract 17.05, Floyd County, Georgia | 43 9 | 4,616 -0.1% | 172 3.7% -14.4% | 3,491 75.6% -5.4% | 3,611 0.7% | 106 2.9% -10.2% | 2,805 77.7% -4.9% |
140-13115001706 Census Tract 17.06, Floyd County, Georgia | 17 5 | 1,878 4.7% | 46 2.4% 53.3% | 1,709 91.0% 1.5% | 1,519 12.0% | 33 2.2% 57.1% | 1,387 91.3% 8.5% |
140-13115001800 Census Tract 18, Floyd County, Georgia | 34 12 | 4,709 2.1% | 250 5.3% 17.9% | 3,869 82.2% -5.3% | 3,640 3.8% | 158 4.3% 27.4% | 3,052 83.8% -3.6% |
140-13115002000 Census Tract 20, Floyd County, Georgia | 22 4 | 4,732 -1.4% | 129 2.7% 46.6% | 4,213 89.0% -3.3% | 3,805 1.6% | 83 2.2% 62.7% | 3,428 90.1% -0.1% |
140-13115002100 Census Tract 21, Floyd County, Georgia | 67 2 | 4,753 8.9% | 672 14.1% -4.1% | 2,216 46.6% 16.1% | 3,820 15.5% | 442 11.6% 4.0% | 1,889 49.5% 23.0% |
Status of sex offenders in Florida
Source: U.S. Census Bureau
* Because tract and legislative district boundaries have changed in some cases, USA TODAY estimated 2020 tract and legislative district population counts based on their new boundaries for consistency.
Total Population Change
'+feature.properties.total_ypc+'%
'; popupContent += '
More
'; return popupContent;}// thisgeo = 2020-050-13115function Gon2Line(val){ if (val['type'] == 'Polygon') { return {"type":"FeatureCollection", "features":[{"type":"Feature", "geometry":{ type: "LineString", coordinates: val['coordinates'][0]}, "properties":{}} ]}; } else { var rd = {"type":"FeatureCollection", "features":[]}; for (let i = 0; i < val['coordinates'].length; i++){ rd["features"].push({"type":"Feature", "id":i, "geometry":{ type: "MultiLineString", coordinates: val['coordinates'][i]}, "properties":{"id":i}}) } return rd; }}mapboxgl.accessToken = 'pk.eyJ1IjoieXB5dW4iLCJhIjoiY2oxcW4ybWhxMDBkMjJxcGVhbDV5cnpzYyJ9.oFQSnOc57xCR7A51OR6-3w';var map = new mapboxgl.Map({ container: 'uscntymap', // container id style: 'mapbox://styles/ypyun/cj83a8ga5abkq2sqpivw3nrzg', //'mapbox://styles/mapbox/streets-v11', // stylesheet location center: [-119.8137, 39.5293], // starting position [lng, lat] zoom: 9, // starting zoom attributionControl: false,});map.addControl(new mapboxgl.AttributionControl({ compact: false, customAttribution:[] }));var stopvar = [[-3,'#FF0014'],[0,'#FF3C14'],[3,'#FF7814'],[6,'#FFB414'],[9,'#C5ED11'],[12,'#8BEB0E'],[15,'#51E80B'],[18,'#18E609'] ];//var G2020_010 = [[[[-125.0011, 24.9493],[-66.9326, 49.5904]]]];var sJSON = {"type":"FeatureCollection", "features":[ {"type":"Feature","geometry": G2020_140_13115000100,"properties":{ "geot__geoid":"13115000100","geot__namelsad":"Census Tract 1, Floyd County, Georgia","geot__sumlevel":"140","geop__pmk":"2010-140-13115000100","geot__pmk":"2020-140-13115000100","pmk":"140-13115000100","total_ypc":0.2, } }, {"type":"Feature","geometry": G2020_140_13115000202,"properties":{ "geot__geoid":"13115000202","geot__namelsad":"Census Tract 2.02, Floyd County, Georgia","geot__sumlevel":"140","geop__pmk":"2010-140-13115000202","geot__pmk":"2020-140-13115000202","pmk":"140-13115000202","total_ypc":-2.0, } }, {"type":"Feature","geometry": G2020_140_13115000203,"properties":{ "geot__geoid":"13115000203","geot__namelsad":"Census Tract 2.03, Floyd County, Georgia","geot__sumlevel":"140","geop__pmk":"null","geot__pmk":"2020-140-13115000203","pmk":"140-13115000203","total_ypc":10.1, } }, {"type":"Feature","geometry": G2020_140_13115000204,"properties":{ "geot__geoid":"13115000204","geot__namelsad":"Census Tract 2.04, Floyd County, Georgia","geot__sumlevel":"140","geop__pmk":"null","geot__pmk":"2020-140-13115000204","pmk":"140-13115000204","total_ypc":8.5, } }, {"type":"Feature","geometry": G2020_140_13115000300,"properties":{ "geot__geoid":"13115000300","geot__namelsad":"Census Tract 3, Floyd County, Georgia","geot__sumlevel":"140","geop__pmk":"2010-140-13115000300","geot__pmk":"2020-140-13115000300","pmk":"140-13115000300","total_ypc":-2.4, } }, {"type":"Feature","geometry": G2020_140_13115000401,"properties":{ "geot__geoid":"13115000401","geot__namelsad":"Census Tract 4.01, Floyd County, Georgia","geot__sumlevel":"140","geop__pmk":"null","geot__pmk":"2020-140-13115000401","pmk":"140-13115000401","total_ypc":7.3, } }, {"type":"Feature","geometry": G2020_140_13115000402,"properties":{ "geot__geoid":"13115000402","geot__namelsad":"Census Tract 4.02, Floyd County, Georgia","geot__sumlevel":"140","geop__pmk":"null","geot__pmk":"2020-140-13115000402","pmk":"140-13115000402","total_ypc":2.9, } }, {"type":"Feature","geometry": G2020_140_13115000403,"properties":{ "geot__geoid":"13115000403","geot__namelsad":"Census Tract 4.03, Floyd County, Georgia","geot__sumlevel":"140","geop__pmk":"null","geot__pmk":"2020-140-13115000403","pmk":"140-13115000403","total_ypc":4.2, } }, {"type":"Feature","geometry": G2020_140_13115000500,"properties":{ "geot__geoid":"13115000500","geot__namelsad":"Census Tract 5, Floyd County, Georgia","geot__sumlevel":"140","geop__pmk":"2010-140-13115000500","geot__pmk":"2020-140-13115000500","pmk":"140-13115000500","total_ypc":2.1, } }, {"type":"Feature","geometry": G2020_140_13115000600,"properties":{ "geot__geoid":"13115000600","geot__namelsad":"Census Tract 6, Floyd County, Georgia","geot__sumlevel":"140","geop__pmk":"2010-140-13115000600","geot__pmk":"2020-140-13115000600","pmk":"140-13115000600","total_ypc":-9.2, } }, {"type":"Feature","geometry": G2020_140_13115000700,"properties":{ "geot__geoid":"13115000700","geot__namelsad":"Census Tract 7, Floyd County, Georgia","geot__sumlevel":"140","geop__pmk":"2010-140-13115000700","geot__pmk":"2020-140-13115000700","pmk":"140-13115000700","total_ypc":1.4, } }, {"type":"Feature","geometry": G2020_140_13115000800,"properties":{ "geot__geoid":"13115000800","geot__namelsad":"Census Tract 8, Floyd County, Georgia","geot__sumlevel":"140","geop__pmk":"2010-140-13115000800","geot__pmk":"2020-140-13115000800","pmk":"140-13115000800","total_ypc":5.3, } }, {"type":"Feature","geometry": G2020_140_13115000900,"properties":{ "geot__geoid":"13115000900","geot__namelsad":"Census Tract 9, Floyd County, Georgia","geot__sumlevel":"140","geop__pmk":"2010-140-13115000900","geot__pmk":"2020-140-13115000900","pmk":"140-13115000900","total_ypc":2.8, } }, {"type":"Feature","geometry": G2020_140_13115001100,"properties":{ "geot__geoid":"13115001100","geot__namelsad":"Census Tract 11, Floyd County, Georgia","geot__sumlevel":"140","geop__pmk":"2010-140-13115001100","geot__pmk":"2020-140-13115001100","pmk":"140-13115001100","total_ypc":-1.2, } }, {"type":"Feature","geometry": G2020_140_13115001200,"properties":{ "geot__geoid":"13115001200","geot__namelsad":"Census Tract 12, Floyd County, Georgia","geot__sumlevel":"140","geop__pmk":"2010-140-13115001200","geot__pmk":"2020-140-13115001200","pmk":"140-13115001200","total_ypc":19.6, } }, {"type":"Feature","geometry": G2020_140_13115001301,"properties":{ "geot__geoid":"13115001301","geot__namelsad":"Census Tract 13.01, Floyd County, Georgia","geot__sumlevel":"140","geop__pmk":"null","geot__pmk":"2020-140-13115001301","pmk":"140-13115001301","total_ypc":11.6, } }, {"type":"Feature","geometry": G2020_140_13115001302,"properties":{ "geot__geoid":"13115001302","geot__namelsad":"Census Tract 13.02, Floyd County, Georgia","geot__sumlevel":"140","geop__pmk":"null","geot__pmk":"2020-140-13115001302","pmk":"140-13115001302","total_ypc":4.4, } }, {"type":"Feature","geometry": G2020_140_13115001400,"properties":{ "geot__geoid":"13115001400","geot__namelsad":"Census Tract 14, Floyd County, Georgia","geot__sumlevel":"140","geop__pmk":"2010-140-13115001400","geot__pmk":"2020-140-13115001400","pmk":"140-13115001400","total_ypc":1.0, } }, {"type":"Feature","geometry": G2020_140_13115001600,"properties":{ "geot__geoid":"13115001600","geot__namelsad":"Census Tract 16, Floyd County, Georgia","geot__sumlevel":"140","geop__pmk":"2010-140-13115001600","geot__pmk":"2020-140-13115001600","pmk":"140-13115001600","total_ypc":-8.6, } }, {"type":"Feature","geometry": G2020_140_13115001703,"properties":{ "geot__geoid":"13115001703","geot__namelsad":"Census Tract 17.03, Floyd County, Georgia","geot__sumlevel":"140","geop__pmk":"null","geot__pmk":"2020-140-13115001703","pmk":"140-13115001703","total_ypc":-1.6, } }, {"type":"Feature","geometry": G2020_140_13115001704,"properties":{ "geot__geoid":"13115001704","geot__namelsad":"Census Tract 17.04, Floyd County, Georgia","geot__sumlevel":"140","geop__pmk":"null","geot__pmk":"2020-140-13115001704","pmk":"140-13115001704","total_ypc":-3.3, } }, {"type":"Feature","geometry": G2020_140_13115001705,"properties":{ "geot__geoid":"13115001705","geot__namelsad":"Census Tract 17.05, Floyd County, Georgia","geot__sumlevel":"140","geop__pmk":"null","geot__pmk":"2020-140-13115001705","pmk":"140-13115001705","total_ypc":-0.1, } }, {"type":"Feature","geometry": G2020_140_13115001706,"properties":{ "geot__geoid":"13115001706","geot__namelsad":"Census Tract 17.06, Floyd County, Georgia","geot__sumlevel":"140","geop__pmk":"null","geot__pmk":"2020-140-13115001706","pmk":"140-13115001706","total_ypc":4.7, } }, {"type":"Feature","geometry": G2020_140_13115001800,"properties":{ "geot__geoid":"13115001800","geot__namelsad":"Census Tract 18, Floyd County, Georgia","geot__sumlevel":"140","geop__pmk":"2010-140-13115001800","geot__pmk":"2020-140-13115001800","pmk":"140-13115001800","total_ypc":2.1, } }, {"type":"Feature","geometry": G2020_140_13115002000,"properties":{ "geot__geoid":"13115002000","geot__namelsad":"Census Tract 20, Floyd County, Georgia","geot__sumlevel":"140","geop__pmk":"2010-140-13115002000","geot__pmk":"2020-140-13115002000","pmk":"140-13115002000","total_ypc":-1.4, } }, {"type":"Feature","geometry": G2020_140_13115002100,"properties":{ "geot__geoid":"13115002100","geot__namelsad":"Census Tract 21, Floyd County, Georgia","geot__sumlevel":"140","geop__pmk":"2010-140-13115002100","geot__pmk":"2020-140-13115002100","pmk":"140-13115002100","total_ypc":8.9, } }, ]};var pJSON = {"type":"FeatureCollection", "features":[ {"type":"Feature","geometry": G2020_060_1311590126,"properties":{ "geot__geoid":"1311590126","geot__namelsad":"Armuchee CCD, Floyd County, Georgia","geot__sumlevel":"060","geop__pmk":"2010-060-1311590126","geot__pmk":"2020-060-1311590126","pmk":"060-1311590126","total_ypc":4.9, } }, {"type":"Feature","geometry": G2020_060_1311590588,"properties":{ "geot__geoid":"1311590588","geot__namelsad":"Cave Spring CCD, Floyd County, Georgia","geot__sumlevel":"060","geop__pmk":"2010-060-1311590588","geot__pmk":"2020-060-1311590588","pmk":"060-1311590588","total_ypc":-1.4, } }, {"type":"Feature","geometry": G2020_060_1311592586,"properties":{ "geot__geoid":"1311592586","geot__namelsad":"Rome CCD, Floyd County, Georgia","geot__sumlevel":"060","geop__pmk":"2010-060-1311592586","geot__pmk":"2020-060-1311592586","pmk":"060-1311592586","total_ypc":2.4, } }, {"type":"Feature","geometry": G2020_060_1311592736,"properties":{ "geot__geoid":"1311592736","geot__namelsad":"Shannon CCD, Floyd County, Georgia","geot__sumlevel":"060","geop__pmk":"2010-060-1311592736","geot__pmk":"2020-060-1311592736","pmk":"060-1311592736","total_ypc":0.2, } }, ]};// aaaa map.on('load', function () { var layers = map.getStyle().layers; var firstSymbolId; for (var i = 0; i < layers.length; i++) { if (layers[i].type === 'symbol') { firstSymbolId = layers[i].id; break; } } //map.addSource("CensusSL",{ "type": "geojson", "data":'/media/jsons/census/d/010/010.json' }); "source": "CensusSL", /"filter": ["any",[">=", "total_ypc", 0]], map.addLayer({"id": "census_main_layer", "type": "fill", "source": { "type": "geojson", "data":sJSON }, 'layout': {'visibility': "visible"}, "paint": {'fill-color': {property: 'total_ypc', stops: stopvar},'fill-opacity':0.8, 'fill-outline-color': '#666666',}}, firstSymbolId); map.on('click', 'census_main_layer', function (e) {new mapboxgl.Popup({ offset: 14 }).setLngLat(e.lngLat).setHTML(onCensusAllFeature(e.features[0])).addTo(map);}); map.on('mouseenter', 'census_main_layer', function () {map.getCanvas().style.cursor = 'pointer';}); map.on('mouseleave', 'census_main_layer', function () {map.getCanvas().style.cursor = '';}); map.addLayer({"id": "census_cousub_layer", "type": "fill", "source": { "type": "geojson", "data":pJSON }, 'layout': {'visibility': "none"}, "paint": {'fill-color': {property: 'total_ypc', stops: stopvar},'fill-opacity':0.8, 'fill-outline-color': '#666666',}}, firstSymbolId); map.on('click', 'census_cousub_layer', function (e) {new mapboxgl.Popup({ offset: 14 }).setLngLat(e.lngLat).setHTML(onCensusAllFeature(e.features[0])).addTo(map);}); map.on('mouseenter', 'census_cousub_layer', function () {map.getCanvas().style.cursor = 'pointer';}); map.on('mouseleave', 'census_cousub_layer', function () {map.getCanvas().style.cursor = '';}); map.addLayer({'id': 'areaBoundary', 'type': 'line', 'source': { "type": "geojson", "data":Gon2Line(G2020_050_13115) }, 'layout': { 'line-join': 'round', 'line-cap': 'round' }, 'paint': { 'line-color': '#288499', 'line-width': 4 } }, firstSymbolId); }); var toggleableLayerIds = [['census_main_layer','Tract'],['census_cousub_layer','City/Town'] ]; for (var i = 0; i < toggleableLayerIds.length; i++) { var id = toggleableLayerIds[i][0]; if (id === 'census_main_layer'){ var otrid = 'census_cousub_layer';} else {var otrid = 'census_main_layer';} var idstr = toggleableLayerIds[i][1]; var link = document.createElement('a'); link.href = '#'; if(i == 0){link.className = 'active';}else{link.className = 'notactive';} link.tgid = id; link.oid = otrid; link.textContent = idstr; link.setAttribute("id",id+'_id') link.onclick = function (e) { var clickedLayer = this.tgid; var anotherLayer = this.oid; e.preventDefault(); e.stopPropagation(); var visibility = map.getLayoutProperty(clickedLayer, 'visibility'); $('.active').each(function() {$(this).removeClass().addClass( "notactive" ); });// $('#ue_county_id').removeClass().addClass( "notactive" );// $('#ue_state_id').removeClass().addClass( "notactive" ); this.className = 'active'; for (tli of toggleableLayerIds) {if(tli[0] != this.tgid){map.setLayoutProperty(tli[0], 'visibility', 'none')}} map.setLayoutProperty(clickedLayer, 'visibility', 'visible');// map.setLayoutProperty(anotherLayer, 'visibility', 'none'); }; var layers = document.getElementById('mapmenu'); layers.appendChild(link);}function getBoundary(ggs){ if (ggs['type'] == 'Polygon'){ return [ggs['coordinates']] } else { return ggs['coordinates'] }}var BounceLine = getBoundary(G2020_050_13115); var bounds = new mapboxgl.LngLatBounds();BounceLine.forEach(function(Tpolygon) { Tpolygon.forEach(function(Tline){ Tline.forEach(function(Tpoint){bounds.extend(Tpoint); }) }) });//plvb: dcg object (2020-050-13115)map.fitBounds(bounds, { padding: 120 });map.addControl(new mapboxgl.NavigationControl(), 'top-left');