1. 39
    Update our GeoJSON Data to Include Restaurant Information by Adding properties
    32s

Update our GeoJSON Data to Include Restaurant Information by Adding properties

Colby Fayock
InstructorColby Fayock
Share this video with your friends

Social Share Links

Send Tweet
Published 4 years ago
Updated 4 years ago

Having a map with a bunch of markers showing locations is cool, but it's not really helpful if we don't know anything about those locations. First, we need to be able to access that data.

Click here for exercise instructions

Colby Fayock: [0:00] While we have over locations on a map, we don't know anything about each location. We don't have any popups to tell us what the locations are. First, we need to store the information somewhere that we can retrieve.

[0:09] We're going to use the properties object to store this information. For instance, we can add a name property where we're going to store that this location is DC Pizza. You can also set delivery to true, which specifies that they deliver.

[0:18] We can do this with as much information as we want where I'm also going to add the phone, website, and some tags, so we know what kind of categories that falls under. Most of them have the same data to all the other locations in this file. Now, if we console.log out our locations, you can now see the properties in each feature.

egghead
egghead
~ 7 minutes ago

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

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

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!

Markdown supported.
Become a member to join the discussionEnroll Today