Weird Issue between Smarty and Google Maps
I’m doing some work on a site that uses the google maps API (which is clean, simple and absolutely fabulous, by the way) and I have bumped into a strange problem. When I draw the page that uses the google maps api with smarty everything works fine, generally. However if I put the {debug} tag into the template (which causes smarty to give you a nice little pop-up window of all of the variables it’s working with, and some other great info) google maps stops working.
This isn’t really that shocking, since there is a bunch of javascript that gets pushed into the page by debug, what is weird, and a pretty large problem is that once I do this, google maps continues not to load, even after the {debug} tag has been removed. I haven’t really dug into what is going on to carefully yet, but its an interesting issue.
Really lame solution found after the jump
Well, I dug into it, and as it turns out, it was not a problem with the debug statement at all. Rather it was an issue because I had done some line formatting in the javascript that called google maps, and put in some carriage returns in the middle of a string. (that string was producing HTML so I didn’t mind having some whitespace in the output). It turns out that this was what was making the map API puke. Just goes to show… make sure you have isolated the problem correctly!
No comments yet.
Leave a comment
Pages
Archives
- January 2012
- December 2011
- November 2011
- September 2011
- August 2011
- July 2011
- June 2011
- May 2011
- March 2011
- February 2011
- January 2011
- November 2010
- May 2010
- March 2010
- January 2010
- December 2009
- October 2009
- September 2009
- August 2009
- July 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008