Eurotrip Mapping Functionality

Events happening in the community are now at Drupal community events on www.drupal.org.
swill's picture

I did a screencast as a little demo of what my mapping functionality is like for eurotrip.com. I basically just wanted to show you all so it may spark some ideas for improving geocoding/mapping functionalities.

Sorry for the quality, YouTube kills it pretty nicely.

Screencast: http://www.youtube.com/watch?v=caUiserZzsM

Cheers,

Swill

ps - you can see the display aspect in action at http://www.eurotrip.com/

AttachmentSize
js_files.zip_.txt5.73 KB

Comments

Great looking site! I'd love

tom_o_t's picture

Great looking site!

I'd love to learn more about which modules you used, and what the customisation was that you mentioned in the screencast. How did you do the clustering? Does the Geonames stuff work like that just by installing that module? Which module did you use for storing the lat & lon?

Cheers, and good luck with this project,

Thomas

nice functionality

AlpesInfo.com's picture

Hi
I like
the site, and like the previous poster would be really interested to know more about the modules used, and other customisation that you needed to do.

I have been playing around with drupal and the available google maps plugins as i want to change my own mountain bike holiday website over from wordpress to drupal

I havent come across a feature in any of the modules that does the zooming in by clicking that you achieve nor handles the clustering that you have managed. both good features

cheers

Phil

modules and code used...

swill's picture

hey guys,
here is a quick overview of what modules and code i am using here. this is not a tutorial for getting the same functionality, but a quick overview of some of the more general concepts.

i am using the following modules:
Gmaps
Gmaps_addons (for cck support)
location (only because gmaps is still somewhat dependent on it for some features)
GeoNames (this is how i am geocoding)
AHAH Forms (this is how i call and load the geonames webservice info when the 'verify' button is clicked. i started with this and hacked it to serve my purposes. this functionality is not officially supported in drupal 5.)
My own custom module that deals with a lot of theming, filtering, search blocks, onclick map overlays, etc...

input overview:
my input interface is using gmap_cck with a bunch of custom javascript (locclick.js, attached) as well as a lot of theming and css to remove the lat/lng fields (which you will notice in the js file) ect...

i am using a custom module to hook_form_alter the form and place in my custom city form element with the verify button. basically it does a geonames webservice call when verify is clicked and then updates the form using my hacked version of ahah forms. it updates the cck lat/lng fields (so i can use with gmap views ect) and locclick.js handles the clicking on the map once the webservice has updated it to place the initial pin.

i am maintaining a database of cities along with aliases for the cities for an easy way to keep my city functionality working they way i want. it is automatically populated with the geonames result if the city has never been searched for before and it returns an existing city if it is already in the database. i do this because if an alias is searched for i want to just pull the correct info rather than having to hit the geonames webservice, its just faster that way. i also want to be able to override the aliases and have multiple aliases per city. for example, geonames has "London, United Kingdom" for london, but "London, England" and "London, UK" should give you the same city. this is how i deal with that...

display overview:
this is just a gmap_view that is being built in my own custom module. i do not have all of the functionality turned on right now, but there are a bunch of filters ect that i am using to customize what is being displayed on that map. also the search box is hooked into the gmap_view in my custom module. i am using a modified version of Clusterer2.js for my clustering functionality. i have changed its functionality so that when a cluster it clicked it autozooms to fit all of the markers in the cluster. i also have it tying in with my searching, so there is some stuff in there that might not make sense (autobound variable being one of them). this is because i do not want the autozooming functionality to be on all the time (causes problem when you try to drag the map, double click the map and that sort of stuff) or you will give very strange behavior. i have flags for when the autozooming should happen and when it shouldnt. this is custom to my implementation.

this is obviously not a complete overview, but will give you a better feel what what all is going on.

please feel free to ask more questions if there are things you are interested in. i apologize that the code is not well documented. i may not be following best practices explicitly, but the code is not totally crap.

cheers,

swill

ps - i cannot attach files to this comment, so the referenced files will be attached to the main discussion.

So jealous!

frdesign's picture

I tried to get similar functionality using available modules and I couldn't get it to work the way I wanted. I've spent the last couple of weeks teaching myself PHP so I can customize things a bit more. I'm currently looking through the Geonames documentation and at least it doesn't look like chinese anymore, more like french - getting there slowly. Luckily I have some experience with databases.

You said Gmap still depends on Location for some features. Could you give some examples? I'm trying to figure out the details on how to begin tackling this.

Thanks,
Freddy

Location and Mapping

Group organizers

Group categories

Wiki type

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: