If I have $’.category a’.

Kaai: Google “mdn Array.prototype.indexOf”

Morello: Kaai. Awesome. Thanks.

Ifill: Kaai do you think you could help me with wrapping my head around what logical steps I need to do to work with an array of GeoJSON data?

Kaai: Sure, throw the array in a fiddle or something

Baumer: This is the basic look of my JSON data. http://kopy.io/yRQ7y

Orehek: Crap I forgot to add my categories. Give me just a second.

Lenhardt: Kaai here is my JSON data. http://kopy.io/mQKNF

Kaai: Alright, so what is your goal?

Correa: Okay. I’m needing to list out all of my “points” into as individual li items based on the category they belong to.

Kaai: I see some of these do not have categories. what about those?

Fosson: So would I need to do an indexOf first and then loop through it and put those items in the correct ul? taplar

Jauch: They will all have categories. I just missed those when I was adding them.

Washko: Every item will belong to at least 1 category.

Kaai: So there are different approaches you could take with this

Kaai: Personally i’d probably go through each one and build another structure with each category containing a list of all it’s points

Mcmakin: Okay. sorry, jquery isn’t what I normally work in. I’m trying to teach myself as I go.

Kaai: I’m ***uming your wanting to build the items in sequence item1, then item2, then item3, . ?

Oliverson: I will eventually end up sorting them by their name which I didn’t include.

Kaai: The name of the item?

Brescia: In the properties there is a name field too but I forgot to include it.

Kaai: One sec, got some stuff in the office i have to knock out

Moorehead: Kaai not a problem. Thanks

Kaai: _TWG_: take a look at this https://jsfiddle.net/4m6ba0ob/

Loparo: Thanks Kaai. working on implementing it now.

Bulger: Kaai I’m getting an “m.features is undefined”

Kaai: Update the fiddle and share out what your trying. i’ll brb, getting some food

Defiore: Kaai https://jsfiddle.net/ThatWebGuy_/L9nopr3h/1/ I know this is a little more than what you asked for.

Chaples: So which part is erroring?

Meglio: It’s the forEach loop you told me to use.

Millholland: Which one? there are two, :

Colbenson: I put a console.log just after the first one and it’s not showing anything in the console so I’m ***uming it’s that one.

Barbare: Depending on how that geo thing is loading the json, you may be having an issue with the ajax request

Abshear: Your trying to do your logic outside of any of it’s callbacks, so that variable may not yet be loaded

Simmons: Console.logpoints right before the forEach and see what you get

Delavega: I get an Obect { urls: Array1, ajaxParams: Object, _layers: Object, options: Object, _leaflet_events: Object, _initHooksCalled: true }

Klatt: Yeah, cause your returning the object returned from the ajax call

Dole: So I’m going to need to rewrite this a little bit taplar_afk

Hatten: Yeah, need to figure out if that method has a success callback option

Livermore: Ok, you can attach a then to it

Pasceri: Try this https://jsfiddle.net/L9nopr3h/2/

Foronda: TypeError: i..then is not a function

Bleifus: Okay. I will do some digging on the git repo for the leaflet.ajax call. Thanks.

Vitolas: Found it. there was a middleware call that I could invoke and then I did the loop taplar_afk

Glenna: I wish I had noticed that before. Thanks for all of the help.

Kastel: If I have $’.category a’.on’click’, function{}; I need to get the data-target and see if the ul has a .show as a cl***. taplar