When looking for restaurants, people like to know if the restaurant serves food to their dietary needs. Maybe they're vegan or lactose intolerant -- either way, we can add another data attribute that allows us to display that information.
Create a new data attribute in our the properties of each location in our GeoJSON file for another category like Dietary Restrictions and set up our popup to include that information!
Instructor: [0:00] By looking at this restaurant, we can tell what they have there, but we can't tell if they're vegan-friendly or not. We can add another attribute inside of our locations file where we can create a new property called vegan. If this location is actually vegan, we can set that to true.
[0:11] Inside of our code, we're going to copy the delivery properties since that's similar with the true and false values. Where inside delivery, we're going to say vegan-friendly. We're going to destructure that vegan property and change that delivery variable to vegan.
[0:23] Now on our map, we can see that if we look at DC Pizza, it says that vegan-friendly is equals yes. Since on Pi Pizzeria, we didn't set that, it's not vegan-friendly.
Member comments are a way for members to communicate, interact, and ask questions about a lesson.
The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io
Be on-Topic
Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.
Avoid meta-discussion
Code Problems?
Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context
Details and Context
Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!