Google Maps jQuery Plugin with ExpressionEngine
2009 5
Yesterday Carolyn blogged about a site we did for NCGives. One of their requests was to have the ability to add locations to an ExpressionEngine weblog and have them display on a Google Map. Seemed easy enough until I realized we also had to make external map controls, display content both in the map bubble and on the page, color code the map points, and auto zoom/center the map. I looked around for existing solutions, such as the SL Google Map Extension, but nothing I found did exactly what our client was requesting. I knew that one of our developers, Brian Landau, had experience with Google Maps, so I started talking to him about what we could do.
Initially,
I setup a weblog in ExpressionEngine that would take in all of the
location information. Aside from the standard content about
the location, I put in two text input custom fields for longitude and
latitude. Since the client wouldn't know the longitude and latitude
coordinates, I put in a link to this website
in the field instructions, which converts a standard address.
After the weblog was setup I worked with Brian to get a template
outputting markup that would work with his Google Maps plugin. It was
easy with ExpressionEngine because I could open a single weblog entries
tag and output the variables the plugin could use to create the map.
The client wanted to show just the location titles below the map and have them
link to the pin point, so JavaScript creates that link and hides the rest of the content. One of the nice things about doing it this way is that even if JavaScript is turned off and you can't see the map, you still get all of the ExpressionEngine content displaying on the page.
See the map at http://ncgives.org/map/
You
might notice that the jQuery metadata plugin is using the "data"
attribute to grab the id, longitude, latitude, and category (which
determines the color of the pin point). Brian is working on adding support for microformats instead using the data attribute, so stay tuned
for that.
So if you're looking to put a Google Map in your ExpressionEngine project, check out this blog post about his creation of his jQuery Google Maps plugin over on the Viget Extend blog, or find more information on how to use it on Github.
i’m in the middle of working on the same project - map in expression engine using jquery as our js library to run it.
i’d suggest maybe you all went the long way around.
expression engine is very good about creating dynamic xml files, so they are created as they are asked for. this way the content going to your xml doc is always current. and since jquery can rip through xml like a hot knife through butter, it’s easy to get your info that way and pass it on to the map through a create marker function.
Hey Bob,
I’m interested to know how you accomplish this your way. Can you do a brief write up?
@bob I would also really like to see an example of the code you’re using, if you’re willing to share it.
hi guys -
i posted a (hopefully) sensible step-by-step in how to accomplish it in our blog.
- bob
Whatever happened to the good old include iFrame map ;)
Next entry: Design Share: Now With 100% More Website
Previous entry: Breaking down the process: Designing LegalRiver.com

Recent Comments
We use it a lot at Hashrocket now. It’s made life a lot easier when coding large-scale applications.
The hardest part of SASS is going back to coding regular CSS after you’ve been in it...
- Dennis on 'Sass: A Designer's Perspective'.
- RORY on 'The Juices and The Flows Have Been Diminished'.
- Linette on 'Design For Efficiency: Photoshop Techniques & Templates'.
Subscribe to Comments RSS