Integrating Google Charts into MapItinerary
Integrating Google Charts into MapItinerary
Video Transcript
00:00It's time for us to continue building up our application. We're in our next step right now. We would want to continue expanding on
00:07Integrating our data that we just got got back
00:10so our next step would actually probably be the link between that response that we get from our on sheet callback and
00:17Integrate that into our application now elementary that we want all these stuff done together
00:23So all this separation that we had earlier of the console log and all this information was probably
00:29Not a great idea to separate it. We didn't have a real need to separate it now
00:35What we could do is in our map itinerary to make our map itinerary more dynamic and more flexible
00:41How about we add a function to our map itinerary and we'll call this function a prototype function
00:47So we're going to go to that map itinerary and we're going to add a new built-in function for this element
00:52So we're going to go to prototype and we'll add a new function and let's say load
00:55set up data source or set up sheet
01:05right, that makes a lot of sense and it would get inside a link and
01:09Probably want to make sure that it doesn't change colors even though
01:11I don't know if that's a reserved word or not
01:13So I'm just going to put their underscore to make sure that we're not in any means or form doing anything illegal
01:19so I'm going to set a function to that setup sheet and
01:23this function is going to have one parameter and
01:26Now that we have this new function setup sheet
01:28I could then once immediately after I create my my map which is right here in line 18
01:34I could instead of all the logic that I have here replace that with our setup setup sheet and
01:44Send into that setup sheet basically the variable of sheet link
01:50Once I've done that I could basically grab everything that is here
01:55Push it out move it right inside of our data object itself
02:01And now instead of creating a temporary variable
02:04We could create a variable that is going to be right inside of our object so we could fetch it at any time that we want
02:10Now on sheet callback could be an internal callback of our method
02:14But let's just see first that this is working so far
02:16So I'm going to save this information and I'm just going to put here a little bit of a alert of some source
02:22I'm going to do a console that log
02:24I'm still being called and if we open up our console so again
02:35I'm going to go to my tools this time around
02:38Firebug open up firebug once I open up my firebug I could jump right into the console
02:44Let me make it a little bit smaller and hopefully we'll get that trace letting us know that we're still fetching that information
02:50So for one we see that we have a small little spelling error
02:55So we definitely want to fix that so once we're saying setup sheet twice instead of actually calling the name of the object
03:01So it's not set up sheet set up sheet, but we want to go to map set up sheet
03:05And by the way if we would have done that we would get also our
03:09Set up sheet function which would make our life way easier inside of Dreamweaver CS6 and hopefully whatever bugs
03:15I have in CS6 right now will be gone long before
03:19You guys download the CS6 version and again, let's see what's going on here
03:26So first of all we have another error and this time this error is because we're fetching a link that doesn't exist anymore
03:31Because we rushed when we copied and pasted but really what we want to do is take that link
03:36That's inside of setup sheet that is being sent to setup sheet and just does set it to that our query and hopefully now
03:43Everything will be linked together and again all these mistakes are so natural and so so
03:50Fundamental you could make those mistakes are completely natural and they're completely fine make a mistake fix it make a mistake fix it
03:56Because that's exactly what a life of a developer is it's not about not making any mistakes
04:00The more mistakes you make the better developer developer
04:04You will become because the big question really is is how long does it take you to solve a mistake?
04:09Not how many mistakes you make so in our case that we see now
04:12Oh, so that our queue doesn't exist anymore in line 38 and we go to line 38
04:17We discover very quickly that it's just because we didn't update it to be this dot queue
04:22Now with that said we could do this over and over and over and it really doesn't matter
04:26It's not about how many bugs you make don't feel bad about bugs as much as I don't feel bad
04:30About bugs the bugs are part of the process and now we can see I'm still a cult is working
