With mapping websites becoming increasingly global in nature, the current model for linking to maps from Drupal using the location.module starts to become unmanageable. At the moment each country must have its own functionality to link to maps and there is no overall linking mechanism.
Google Maps displays street maps for the US, Canada, much of Europe (UK, France, Germany, Italy, Spain, Portugal, Austria, Switzerland, Lichtenstein, Belgium, Netherlands, Sweden, Norway, Finland, Andorra, Czech Republic, Slovakia, Poland, Hungary, Greece, Turkey, and probably a few more), Japan, Australia and New Zealand. In addition to the maps, they have satellite coverage for the whole globe. Other mapping providers such as Ask.com maps, Microsoft Live Local and Yahoo maps have similar coverage.
In terms of the current architecture, if a site wants to be able to link to maps from each of these four providers for each of the countries supported by these mapping sites, there would be a lot of duplication and perhaps only minor changes between the linking options. The benefit is that you can choose the address format and options that you use to link to the site by changing the code; this is useful because different map providers accept different combinations of input (eg, include the country name in a Ask.com query and the result will not be returned, but use only the city name and it will work) and each country has slightly different addressing formats.
To build upon the map linking options that we currently have in the location.module, I would like to propose some improvements, some of which were suggested in #25086 before the then hard links to Yahoo were made to be more flexible.
- Centre the map link functionality on map providers, not countries. For each map provider, functions should exist to produce the following:
- a link using address information in a relatively standard format for use across different countries (eg street, city, postal code, country)
- a link using coordinate information
- Allow for users to choose whether to link to map using address information or coordinate information. This should be on a country level, per mapping provider, to take into account different levels of mapping information and linking options available for each country in each mapping provider.
- Allow address format to be customized on a per-country, per-mapping provider basis.
I'd suggest displaying a list of countries down the left hand side of a grid, map providers across the top, and for each country/provider combination you have a dropdown that lets you select whether you link to it using the address, using the latitude and longitude, or not at all. There could be then a link to customise address format, if absolutely necessary.
Comments, suggestions, anyone?
Comments
Comment #1
ankur commentedThis was something I had to think about when it was first implemented. The problem at the time is that the Yahoo! Maps for Canada had a slight different Terms Of Service for its Canadian data than it did for its US data. Another thing to consider is the fact that Yahoo! maintains a map site at http://ca.maps.yahoo.com while a different one at http://maps.yahoo.com even though they both offer mapping of Canada AND US addresses.
The only thing that is redundant between location.us.inc and location.ca.inc is that they both use the same logic to string together the HTTP GET variables of the deep link.
The same applies to Google. The logic is the same and can potentially live in one function overall, perhaps in the location.inc file, but there will often be the case where some of the data from different countries will have a different Terms of Use than does data for another country. That's why I welcome a patch that builds the GET portion of the link, but leaves domain (unless its the same for all countries) and generation of TOS links upto each individual .inc file.
Comment #2
marcoBauli commentedJust a note:
the gmap_location.module provided with the Gmap.module package offers provider(Google)-based geocoding.
It does not however store addresses (as the Location.module does), but uses them only to get lat,lon.
A QUESTION:
Any integration of functionalities between Location (store addresses) and Gmap_location (provider geocoding) would be possible, and if yes from which side would be more appropriate to start from?
This would be usefull for saving the user from entering address twice, one for geocoding and one for output on node page.
Thank you
Comment #3
catchI'm sure there's a better issue to mark things duplicate against, but this is a start.
duplicates:
http://drupal.org/node/60383
http://drupal.org/node/33039
http://drupal.org/node/19469
Comment #4
catchMarking as duplicate of this: http://drupal.org/node/132541
Comment #5
yesct commentedwhich should be the master discussion of geocoding?
this or #132541: refactor google geocoding
Comment #6
yesct commentedjust rewriting the references to show titles from #3 were marked as duplicates of this issue:
#60383: Better geocoding support
#33039: Better support for exact latitude and longitude lookups
#19469: Change to User-Centric. Topic was: "default postal codes for locations?"
Comment #7
Xabi commentedI also can't get the geocoding to work for Spain and some Hispan American countries. Subscribing.
Comment #8
UNarmed commentedThere are so darn many duplicates of this thing, If only there was somewhere i could find concise instructions as to how i should go about getting my country to geocode.