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

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.