GMap Module significantly updated

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
webgeer's picture

I just wanted to let everyone know that I have significantly updated the gmap.module. The most significant update is that there is now the module gmap_location.module packaged with it. This module includes the ability to display nodes that have lat/lon location information associated with them on a common map. It also includes a block that will show the current node on a google map.

Some of my big future plans for the gmaps modules:

  • add a gmap_feeds module that will create a node that includes a map with map feeds. This will also include the ability to parse feeds in a number of different formats from other sites and then convert to JSON for displaying on the google map. It should be noted that the current version of the gmap.module can display a feed from the host. $mymap['feeds'][]['url']='/taxonomy/term/5/0/feed' ;  $mymap['feeds'][]['markername']='blue';
  • separate module to parse gpx files. This will be done as a new node type for gpx files. The trail would be shown on a map. I would also like to include a graph of elevation change and possibly of speed as part of the module. Personally I would prefer to do the graphs as svg graphics, but perhaps that isn't universal enough yet...

However, initially my focus will be on cleaning up the code for the existing modules. One big change that needs to be done is split lat,lon. Currently in gmap the lat,lon are always group together as one variable. This really needs to be split apart for maximum usability. I will probably try and keep it backwards compatible as much as possible, so that existing function calls will continue to work.

Comments

James, this is great work

robertDouglass's picture

I'm so happy that you've kept on making steady improvements to your module. It has become a very very useful tool.

This is awesome

zacker's picture

Question though: What is te purpose of the map feeds? What data shows up in these feeds?

RSS feeds

webgeer's picture

Actually they are not map feeds, they are normal feeds from the drupal site that include location information. (location.module adds the location information for any location enabled node in a feed).

An example is shown on http://photo-tips.ca/node/42 which contains a macro which takes a feed containging all of the photos about bridges and puts them on one map.

The real power of this will be when the site will relay off-site feeds which could have all kinds of information on it.

James

Walt Esquivel's picture

Hi webgeer,

Your gmap work is most excellent!!! Congrats on all the enhancements/updates.

The rest of my comment is probably more appropriate for Moshe.

Back in January 2006, I had encouraged folks to join a DrupalUsers map on Frappr that I created since drupal.org did not, as far as I know, have that functionality and since groups.drupal.org did not exist at the time.

I'd like to discontinue my DrupalUsers map on Frappr (for Drupal users).
138 members as of Jun 12 '06.
[Edit: 142 members as of Jul 7, '06.]
[Edit: 192 members as of Nov 21, '06.]

My goal would be to shut it down/delete DrupalUsers on Frappr once we have that functionality up and running somewhere on groups.drupal.org and after I've given the members an opportunity to post their info here (I would put a message on the Frappr page).

Any suggestions on how to proceed and whether or not someone will be enabling the funtionality at "DrupalUsers map on Frappr" here anytime soon?

By the way, there is also a DrupalDevs group that would probably be better if located here at groups.drupal.org as well. It was created by Gundalo and I can notify him after I hear back from you to see if he would be willing to shut down DrupalDevs on Frappr as well after allowing his members to sign up here.
73 members as of Jun 12 '06
[Edit: 74 members as of Jul 7, '06.]
[Edit: 79 members as of Nov 21, '06.]

What do you think?

Again, thanks for all the wonderful work both webgeer and Moshe are contributing! Most excellent!!! :)

Walt Esquivel, MBA; MA; President, Wellness Corps; Captain, USMC (Veteran)
$50 Hosting Discount Helps Projects Needing Financing

[Edit: The above issues was crossposted to http://groups.drupal.org/node/970 and that is where updates to the Frappr maps' status should be posted. Moshe responded by stating, yes, gmap wants to be here (on groups.drupal.org vs. Frappr).]

Walt Esquivel, MBA; MA; President, Wellness Corps; Captain, USMC (Veteran)
$50 Hosting Discount Helps Projects Needing Financing

geoquote module

joe.murray's picture

I know Dan Robinson has been doing a bunch of work on mapthing.

Just to let people know about one use for this wonderful gmap module. I got Paul Newby to put together a module that shows the name and a quote from them drawn from a custom CiviCRM field on a Google Map using gmap. Mousing over a bubble in the gmap pops up the name and quote. Pretty cool. Very nice for showing support across an electoral district, country, etc. Right now the module allows only a single field to be specified for the text, but this could be generalized and put into simple admin interface.

I'd also like to see the value of a CiviCRM / Drupal custom field used to change the colour of the Google bubble. That way responses to a question like what is the most important issue in this election could be easily viewed on a gmap.

Once I get a CVS account approved, I'll post the code somewhere. At the moment, I can't attached the module or setup.txt to this post.
Joe Murray

Joe Murray

Use of the API for mapthing

drob's picture

I'm finally sitting down to look at leveraging gmap to create the maps for mapthing. A couple of questions after looking at the code -

1) In my code I actually return to the rendered map, clear the markers and repaint - not sure how I would do this with the API? I guess I could create a new map - but wouldn't this cause a javascript memory leak?

2) I have an issue displaying more than one map per html page right now. I assumed that this was because I was reusing a global javascript variable "map" - however now I'm thinking that it might be a problem with the div id? This is not a gmap issue - but I thought you might be able to shed some light before I go off spinning my wheels :).

3) Are you calling an "unload" event as suggested in the googlemap API doco?

Thanks!

I'm not sure I understand.

webgeer's picture

1) I'm not sure I understand. Are you saying that in mapthing.module, you draw the original version of the map and then some event causes you to clear the markers and get new data and draw the new markers? If so, we can work on gmap.js to add a clearmarkers function, to facilitate this. (This needs to be done anyway). Everything else should be able to be done with the js you can pass to gmap_draw_map. On the other hand if this was just your method of manipulating the map for display based on different data sets, I suggest that you instead manipulate the gmap associative array variable and then not draw it until you are finished manipulating it.

2) The div and the js variable must have unique names for each map. In gmap.module you have to make sure that you set separate "id" for each map.

3) No, Unfortunately I don't know of an easy way of doing this in Drupal. If you have some suggestions...

ain't that the way....

drob's picture

1) yes - a user can choose a different data set which will cause the markers to be removed and new ones to be drawn - you can see this in my code - I already do this in my module - but it can probably be done more cleanly.

2) Ok - as I suspected - the only thing is that I see a global variable in your .js file (I know because I stole the code :) ) - where do you name the new js variable (I would think this would have to go in an array somewhere for safekeeping).

3) I looked at this a couple weeks ago. See http://drupal.org/node/57635.

What are the next steps?

Location and Mapping

Group organizers

Group categories

Wiki type

Group notifications

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