I wrote a function to create geoJSON, and it spits out results such as the following:
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"StreetAddress":"3112 Gaddis Road, Canton, Georgia 30115","Name":"Woodmont","Bedrooms":"6-Mar","Bathrooms":"5-Feb","Garage":"2","StartPrice":"Mid $300s","Soldout":"FALSE"},"geometry":{"coordinates":[-84.35505189999999,34.2319281],"type":"Point"}},{"type":"Feature","properties":{"StreetAddress":"7040 Majors Road, Cumming, Georgia 30040","Name":"Ashford Manor Enclave","Bedrooms":"7-Apr","Bathrooms":"2.5-6","Garage":"2","StartPrice":"$375,990 ","Soldout":"FALSE"},"geometry":{"coordinates":[-84.2036578,34.1641024],"type":"Point"}},{"type":"Feature","properties":{"StreetAddress":"977 Woodbury Road, Canton, Georgia 30114","Name":"River Green","Bedrooms":"7-Mar","Bathrooms":"2.5-6","Garage":"2","StartPrice":"$245,990 ","Soldout":"FALSE"},"geometry":{"coordinates":[-84.524852,34.219029],"type":"Point"}},{"type":"Feature","properties":{"StreetAddress":"3983 Paul Samuel Rd NW, Kennesaw, Georgia 30152","Name":"Summerhour","Bedrooms":"7-Apr","Bathrooms":"2.5-6","Garage":"3","StartPrice":"$375,990 ","Soldout":"FALSE"},"geometry":{"coordinates":[-84.6657365,33.9875893],"type":"Point"}},{"type":"Feature","properties":{"StreetAddress":"4550 Hickory Road, Holly Springs, Georgia 30115","Name":"Oakhaven","Bedrooms":"6-Mar","Bathrooms":"2.5-5","Garage":"2","StartPrice":"$272,990 ","Soldout":"FALSE"},"geometry":{"coordinates":[-84.4282121,34.1675759],"type":"Point"}},{"type":"Feature","properties":{"StreetAddress":"3210 Five Forks Trickum Rd, Lilburn, Georgia 30047","Name":"Brookstone Preserve","Bedrooms":"7-Apr","Bathrooms":"6-Feb","Garage":"2","StartPrice":"High $300s","Soldout":"FALSE"},"geometry":{"coordinates":[-84.06380329999999,33.8794093],"type":"Point"}},{"type":"Feature","properties":{"StreetAddress":"4950 Hickory Road, Woodstock, Georgia 30188","Name":"Woodhaven Court","Bedrooms":"4-Feb","Bathrooms":"3-Feb","Garage":"2","StartPrice":"$252,990 ","Soldout":"FALSE"},"geometry":{"coordinates":[-84.420323,34.16809],"type":"Point"}},{"type":"Feature","properties":{"StreetAddress":"5615 Grand Reunion Drive, Hoschton, Georgia 30548","Name":"Reunion","Bedrooms":"7-Apr","Bathrooms":"2.5-6","Garage":"2","StartPrice":"$274,990 ","Soldout":"FALSE"},"geometry":{"coordinates":[-83.863038,34.114602],"type":"Point"}},{"type":"Feature","properties":{"StreetAddress":"922 Wooten Lake Road, Kennesaw, Georgia 30144","Name":"Falls Crest","Bedrooms":"4-Feb","Bathrooms":"3-Feb","Garage":"2","StartPrice":"$292,990 ","Soldout":"FALSE"},"geometry":{"coordinates":[-84.5774563,34.05599],"type":"Point"}},{"type":"Feature","properties":{"StreetAddress":"105 Park Haven Lane, Tyrone, Georgia 30290","Name":"River Crest","Bedrooms":"7-Apr","Bathrooms":"2.5-6.5","Garage":"3-Feb","StartPrice":"$292,990 ","Soldout":"FALSE"},"geometry":{"coordinates":[-84.5801833,33.508861],"type":"Point"}},{"type":"Feature","properties":{"StreetAddress":"413 Spring View Drive, Woodstock, Georgia 30188","Name":"Woodview Enclave","Bedrooms":"7-Apr","Bathrooms":"2.5-6","Garage":"3-Feb","StartPrice":"$318,990 ","Soldout":"FALSE"},"geometry":{"coordinates":[-84.4685219,34.1075786],"type":"Point"}},{"type":"Feature","properties":{"StreetAddress":"1340 Terrell Mill Road, Marietta, Georgia 30067","Name":"Ivy Crest","Bedrooms":"4-Mar","Bathrooms":"2.5-3.5","Garage":"2","StartPrice":"$341,990 ","Soldout":"FALSE"},"geometry":{"coordinates":[-84.46576999999999,33.9195719],"type":"Point"}},{"type":"Feature","properties":{"StreetAddress":"4604 Shiloh Road, Cumming, Georgia 30040","Name":"Shiloh Ridge","Bedrooms":"6-Apr","Bathrooms":"2.5-5.5","Garage":"2","StartPrice":"$357,990 ","Soldout":"FALSE"},"geometry":{"coordinates":[-84.2027887,34.1456647],"type":"Point"}},{"type":"Feature","properties":{"StreetAddress":"2750 Kimball Bridge Road , Alpharetta, Georgia 30009","Name":"The Walk at Braeden","Bedrooms":"4-Feb","Bathrooms":"2-3.5","Garage":"2","StartPrice":"$378,990 ","Soldout":"FALSE"},"geometry":{"coordinates":[-84.2779815,34.0626187],"type":"Point"}},{"type":"Feature","properties":{"StreetAddress":"1057 N Jamestown Road, Decatur, Georgia 30033","Name":"Parkside at Mason Mill - The Overlook","Bedrooms":"4-Mar","Bathrooms":"2-3.5","Garage":"2","StartPrice":"$420,990 ","Soldout":"FALSE"},"geometry":{"coordinates":[-84.3031443,33.8114372],"type":"Point"}},{"type":"Feature","properties":{"StreetAddress":"4400 West Atlanta Road SE, Smyrna, Georgia 30080","Name":"4400 West","Bedrooms":"4-Mar","Bathrooms":"2.5-3.5","Garage":"2","StartPrice":"$429,990 ","Soldout":"FALSE"},"geometry":{"coordinates":[-84.49285309999999,33.845839],"type":"Point"}}]}
For whatever reason, it refuses to work unless I go in and physically hit enter in my text editor to break up each line in the Features array. Strictly speaking I'm not sure why this works, or how I can change my function to write code that's copy-paste ready. Any ideas as to what is going wrong here?
edit: to be clear, I get an unidentified token error when I attempt to assign this to a variable, and my JavaScript breaks. I'm not sure why I'm getting downvoted for what is apparently a good question, since nobody has solved the issue yet.
Picture 1 of the json "breaking" invisibly:
After enabling soft wrap and then hitting enter a couple of times in between each item of the feature array, you can see this about halfway to working:
In order for it to fully work, I would have to hit enter for every single item to break the lines. I hope my question is clear now.
edit 2 - Here's an issue I found related to a bug that causes the syntax highlighting to break: bug
Still, that shouldn't cause the JSON to otherwise be invalid.
Here's what it looks like after I've hit enter on everything:
To make matters even more odd, the geojson works fine as is if I enter it into codepen.