Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Display articles on a Google Map
On my thesis website, most of the articles are associated with some geographic location. I used Textpattern to plot every article on a Google Map “mashup.” There are no plugins required here; I built the map using a JavaScript, custom fields, and a few page and form templates. Data are generated on-the-fly, so the map will be updated automatically as I add new articles.
http://davidramos.org/thesis/projects
I store latitude and longitude information for each article in custom fields. The map goes in its own section, with its own page template, along with a JavaScript that draws the map. The JavaScript then pulls in XML data about each article from a a second hidden section.
I wrote up a first draft of a tutorial on how to do this:
http://davidramos.org/thesis/google-maps-in-textpattern
Note that the method I used is a relatively complicated one. It suited my needs well, but instead one could specify the map points in a JavaScript, then use TXP to create the script dynamically.
Last edited by adr (2006-08-02 17:40:03)
Offline
Re: Display articles on a Google Map
this is very cool adr. Will be studying your tutorial soon
Last edited by colak (2006-07-22 17:05:57)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: Display articles on a Google Map
Thanks for the very clear tutorial.
I already had the API key, so it only took me around 15 minutes to have my first map up with my home marked on there.
Now I just want to do a little tweaking of the default styling of the google map, and I think I’ll start populating it with some more locations.
Absolutely brilliant! And to think that I was going to try to figure this out on my own …
Offline
Re: Display articles on a Google Map
this is great. ADR, you mentioned that you used an external xml file, but I didn’t see that described in your instructions anywhere. what’s in the xml file? and did you skip its use for this tutorial?
also, have you learned anything new since originally writing this? any additional advice?
thanks!
Last edited by mwillse (2007-08-17 23:10:57)
Offline
#5 2007-09-01 03:23:35
- szac
- Member
- From: Detroit-ish
- Registered: 2004-09-18
- Posts: 50
Re: Display articles on a Google Map
Step 5 is about the xml. He’s layed out a texpattern page and form to be the xml.
Offline
#6 2007-09-02 15:00:44
- guiguibonbon
- Member
- Registered: 2006-02-20
- Posts: 296
Re: Display articles on a Google Map
This is brilliant!! There’s this project that has been lingering in my head that needs to do just that. Didn’t know if if was possible. I’m so excited now! Great job!
I’m wondering though, would it be possible to do this with an address in the custom field instead of coordinates?
Offline
#7 2007-09-07 01:21:07
- szac
- Member
- From: Detroit-ish
- Registered: 2004-09-18
- Posts: 50
Re: Display articles on a Google Map
Rob Sable’s rss_google_maps plugin uses addresses to show location on the map.
From option 2 of the plugin help:
1. You designate which custom fields in an article contain address data. By default, custom fields 1 – 4 are used.
2. Set the address fields in a new article.
3. When the plugin is called, the addresses are looked up using the Yahoo! Maps geocoding service.
4. If the location is found, the coordinates are added to the Google Map display using the Phoogle Maps PHP class.
Offline
Pages: 1