[eluser]mtbkrdave[/eluser]
Hi Y'all - CI newbie checking back in with another [hopefully] quick question...
So I want to include a Google Map on some of the pages of my CI site. To do this, I've got to drop the Map generation/control javascript in my header, then hold a spot for it in my body section. I'm using different views for header, body and footer.
I'm just about to bite into coding, and my plan at this point is to:
1) Use a model to define several functions which pre-build the GMap javascript code for the different maps I need, dipping into my MySQL database to pull coordinates for each map's marker[s].
2)Pass a single $data array from controller to view,
optionally containing map code if the page is supposed to have a map.
3) Put a conditional (e.g. if( isset ( $data["map_source"] ) {} ) into the header view that only echoes out the map source code if it's been inserted by the controller.
Am I even close to the right way to do this?
Thanks,
[medic]Dave