Attached is an initial outline of proposed ideas for the 2x branches. I would like feedback and input. Thanks, Jeremy.

CommentFileSizeAuthor
#4 doc.pdf54.81 KBjjchinquist
6.x-2.x_project_spec.txt2.33 KBjjchinquist

Comments

jjchinquist’s picture

http://drupal.org/node/344757#comment-3211044

Request by Martijn to integrate GMAP fields.

the greenman’s picture

I feel that we should keep the geomap "node ignorant". There are many other modules that handle geodata, my feeling is that we should rather collect a few theming tools that allow other modules to embed geodata in microformats.

There needs to be a way to pass config information to the javascript, my suggestion is an element with a specific id "geomap-options". We can then look at atttributes or sub elements that can specify things like icon location. There are a bunch of formatters in the geonames_cck module that should probably be moved into here and made more generic.

The drag and drop code in the JS files are very specific to the geonames_cck module too. We need a way to pass callback information to the script.

summit’s picture

Hi, I think next to gmap, cck_location it would be great to keep location into consideration.
greetings, Martijn

jjchinquist’s picture

StatusFileSize
new54.81 KB

Continuing with the ideas put forth in the attached .txt (above) and with the comments here, as well as after talking to greenman, the result is the idea that there will be a core "geomap" module, then there will be several contributed modules (geomap_geonames_cck, geomap_cck, geomap_location, geomap_views2) that would contain theming functions required to translate their individual data storage methods with the geomap geo microformat specification.

See the attached pdf.

Furthermore, I suggest a more robust form of the geo microformat so that the Drupal community can really start to make use of the module. As contained in the pdf, this is my first idea:

<div class="geo" title="Canterbury">
  Canterbury, United Kingdom
  <span class="latitude" >51.2667</span>
  <span class="longitude" >1.08333</span>
  <div class="marker" >
    <div class="infowindow" title="<html or text for window>">
      <div class="option" name="<name>" value="<value>" />
    </div>
    <div class="icon" src="" >
      <div class="option" name="<name>" value="<value>" />
    </div>
  </div>
  <div class="node" nid="" link="" />
</div>
summit’s picture

Hi,
I really like these ideas! Location is very well spread, so may be good to put on top of list for 6.2?
And location/gmap also integrates nicely with views right now.
Just a suggestion of course.
Greetings, Martijn

jjchinquist’s picture

Martijn,

It would help me if you have feedback regarding the specification - questions, concerns, changes, etc. I need critique here (but thanks for the praise).

summit’s picture

Hi, trying to think with you. There has been build a feedapi_scraper..because if I understand you correct, you would want to scrape the page, and see if geo information which could be a place, or address, or country or province or area is somewhere. If there is geo information, then try to see if from this information a map can be shown? Right? Off course it would be great if the map would show any geo-info which is on the current page, without the user using geo-module?

May be consider (if I am correct in understanding), a in-between layer, if the module is not completely satisfied with the criteria, that the user can finetune, how in his site he wants the module to pick up the geo-info, with say html-elements, divs etc..

greetings, Martijn

jjchinquist’s picture

Hi Martijn,

I see that you need to get your head around the module first :).

For an example of the module, you can look at 2 example sites: http://www.kindergeburtstag.co.at (look at the very bottom of the page - the map will be improved over the coming weeks) and schoolofeverything.com (http://schoolofeverything.com/venue/novas-scarman-centre-london)

The geo html is printed to the page in simple HTML. The javascript then loops through all instances of class="geo" in the HTML to create the Google Map.

Download Drupal 6.x-1.0-beta2 and test it out.

I hope to lock in the Geo Microformat system for the 2.x soon but will need input (especially from greenman who currently knows more of this project than I do ;). I do not want to make a mistake with the tags, only to find out too late that the tags will cause conflict problems.

My goal is that geomap becomes flexible enough to work well for other websites and we get a few others interested to test/help out.

Kind regards,

Jeremy

jjchinquist’s picture

Slight update to the geo microformat to make it compatible with the specification (http://microformats.org/wiki/geo):

<div class="geo" title="Canterbury">
  [displayed title: e.g. Canterbury, United Kingdom]
  <abbr class="latitude" title="51.2667">[display form of latitude: e.g. N 51° ZZ.ZZZ]</abbr> 
  <abbr class="longitude" title="1.08333">[display form of longitude: e.g. W 1° ZZ.ZZZ]</abbr>
  <div class="marker" >
    <div class="infowindow">
      <div class="infowindow-text">[html or plain text for window]</div>
      <div class="infowindow-option" name="<name>" value="<value>" />
    </div>
    <div class="icon" src="" >
      <div class="option" name="<name>" value="<value>" />
    </div>
  </div>
  <div class="node" nid="[nid]" link="[full drupal path including http://... ]" />
</div>
jjchinquist’s picture

Idea for the js file (in reference to http://drupal.org/node/242602)

There are so many different ways that people would like to customize the JS file itself - such that it calls for a great amount of customization.

What about a scheme where if the "jquery.googlemaps.js" file is present in "[files directory]/geomap/jquery.googlemaps.js" then this .js file is loaded, otherwise the default included with the geomap module? Would help with upgrading? suggestions?

the greenman’s picture

Main module notes:

I am a big fan of very focussed modules. My preference is that the geomap module should really only include formatters that allow it to interact with other modules - and not have anything to do with views directly. The map system already works perfectly with views, because it just uses the page content. Geonames_cck is already it's own module, so we just need a new release of that if we are updating the geo formatting.

However, that said, it might be helpful to people if there were one helper module that allowed easy specification of lat and long parameters. Once you add something at content level, then you need the views stuff. Lets just be cautious of adding unnecessary modules that duplicate functionality already in contrib.

Javascript
We need to allow some way to configure the map. I have ended up using an ID called #geomap-settings that allows me to add some parameters. My current implementation probably breaks xhtml compliance so needs to be updated.

The current JS file contains a load of features used to integrate with geonames_cck. It handles marker drag and drop and all sorts of stuff. I think this could be very useful, but it needs to be genericised. In order to do this we would need a small extension to geomap that would allow other modules to implement hooks.

I am not sure about extending modules to look for optional extra jquery files. I think it's probably best to encourage extra jquery functionality to be handled in the theme or a seperate module. Doing special things with jquery adds some small caching issues, but probably nothing major.

I have some time this evening, I will take a deeper think about things

the greenman’s picture

I like the microformat suggestions. I would want to think a bit about how to add callback info. Although that is probably done in some global config. The callback stuff should be an extension module anyway.

jjchinquist’s picture

Please post the implementation of this #geomap-settings. That may be a better place to start than what my brainstorming was coming to.

the greenman’s picture

I found that I needed to be able to pass setting to the map. My only requirement so far has been to change the default zoom distance used when there is only one point on the map. I settled on what I consider half a hack.

I added a div to the page body, with the parameter I needed :

<div id="geomap-options" zoomdistance="0.01"/>

Then I modified the distance calculation code in the js file to look for a setting:

// time to zoom the map
      var distance = 0.015;
      if ($('#geomap-options').attr('zoomDistance')) {
        distance = Number($('#geomap-options').attr('zoomDistance'));
      } 
      else if ( markers.length == 1 ) {
        // if we only have one marker, we move out a bit more
        distance = 0.5;
      }

This works, but, I think it would need a little refinement. Arbitrary attributes would require a namespace, and it may be best to just use some other element already defined. The main jquery code would need to have some general way to manage it's defaults, and their overriding via this method.

the greenman’s picture

I have thought about suggestions for Jquery extensions to be outside of this module, but have realised that the extensions will probably all need to effect the individual markers.

I would need to look at how other modules can get hold of and modify the markers.

jjchinquist’s picture

Version: 6.x-1.0-beta1 » 6.x-2.x-dev

Published a first dev release. See its changelog for information.
Comments are welcome. No API decisions have been solidified yet.

jjchinquist’s picture

Map settings, infowindow settings, etc.

I feel that there are too many variations and settings - window behaviour settings, marker behaviour settings, etc. - such that there has to be a way to override the whole .js file itself (otherwise the original geomap module becomes too bloated with check boxes and settings). I see three ways (two are in my opinion viable solutions) to do this:
1) Allow the JS file to be overridden by making a copy of the file in the theme or files folders.
2) Allow the JS file code to be imported into the Drupal database as a variable. The User can then override the database variable (with an option of resetting to the original) via the /admin/settings/geomap Drupal API.
3) Add a sub-module to Geomap called "Geomap Map Customizations". This module checks for and loads one JS file that must be manually added to its directory (the JS file is not present originally and will not be overridden when a geomap update occurrs. A programmer will have to then edit the Prototype object through the JS in order to override the original Object's behaviour. This option is fairly advanced however, but I think an interesting idea.

The goal should be to attain more through simplicity and usability.

jjchinquist’s picture

Another Update to the parameters so that things can function - any feedback is welcome. Link to the specification (http://microformats.org/wiki/geo):

The minimum requirement is the lat/lng parameters, all other markup is optional and specific to the Geomap specification.

<div class="geo" title="Canterbury">
  [displayed title: e.g. Canterbury, United Kingdom]
  <abbr class="latitude" title="51.2667">[display form of latitude: e.g. N 51° ZZ.ZZZ]</abbr> 
  <abbr class="longitude" title="1.08333">[display form of longitude: e.g. W 1° ZZ.ZZZ]</abbr>
  <div class="marker" >
    <div class="infowindow">
      <div class="infowindow-text" id="[geomap managed id]" bind="[if HTML this must be set to true, default false]">[html or plain text for window]</div>
      <div class="infowindow-option" name="<name>" value="<value>" />
    </div>
    <div class="icon" src="" >
      <div class="option" name="[name]" value="[value]" />
    </div>
  </div>
  <div class="link" name="link" value="[full drupal path including http://... ]" nid="[optional nid - if path not present, links to this]" />
</div>
jjchinquist’s picture

Status: Active » Closed (fixed)

closing issue. New features should be added for 7.x-3.x.