You are here

README.txt in GMap Module 7.2

Same filename in this branch
  1. 7.2 README.txt
  2. 7.2 thirdparty/README.txt
  3. 7.2 vendor/README.txt
Same filename and directory in other branches
  1. 5 README.txt
  2. 6.2 README.txt
  3. 6 README.txt
  4. 7 README.txt
GMap Module
===========

GMap is an API and a related set of modules which allows the integration of
Google Maps with a Drupal site.

gmap.module: The main module. Contains the API, the basic map functions, Views
integration and an text filter to create macros into working maps with minimal
effort.

gmap_location.module: Provides map features for Location.module (v2 and v3).

gmap_macro_builder.module: End-user UI for easily creating GMap macros.

gmap_taxonomy.module: API and utility for changing map markers of for points
from Location.module based on taxonomy terms.

Installation
------------

To install, follow the general directions available at:
https://drupal.org/documentation/install/modules-themes

In order to use this module, you need a (free) Google Maps API key. Here is how
to get one:

1. Login using a Google account to https://code.google.com/apis/console
2. Create project
3. Go to 'Services' and turn on 'Google Maps API v2' and 'Google Maps API v3'.
4. Go to 'API Access' and copy the API Key from the "Simple API Access" section.
5. Paste the API Key into the GMap settings page at admin/config/services/gmap.

You may need to make changes to your theme so that Google Maps can display
correctly. See the section on "Google Maps and Quirks Mode" below.

If you would like to use GMap macros directly in nodes, you will need to add
the GMap Macro filter to an text format (or create a new text format that
includes it). Read http://drupal.org/node/213156 for more information on text
formats.

If you are using the HTML filter, it will need to appear BEFORE the GMap filter;
otherwise the HTML filter will remove the GMap code. To modify the order of
filters in an text format, go to the "Rearrange" tab on the text format's
configuration page (Administer > Configuration > Content authoring > Text
formats, then click "configure" by your format).

If you would like to use third party functionality such as custom marker
libraries read thirdparty/README.txt for download links and instructions.

If you are translating this module to a different language also see the
gmap.strings.php file for further installation instructions.  This is required
for translation of marker type strings to work.


Google Maps and Quirks Mode
---------------------------

Google Maps may have rendering issues when a doctype is not declared on your
site. Specifically, Google Maps will have problems when the browser is using
"quirks mode". To render pages in "standards compliant mode", use either an
HTML5 doctype or XHTML Strict doctype as the first line of your HTML:

HTML5 doctype:

<!DOCTYPE html>

XHTML Strict doctype:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


Views Integration
-----------------
The GMap module includes built-in integration with the Views module. You can use
this to turn any list of nodes, users, or other content into a Google Map that
plots each item on a map.

To make a GMap-based view, create or edit a view under Administer > Structure >
Views. Under the "Format" section, change the format by clicking on the current
format type (usually "Unformatted list"). Then change the format type to either
"GMap" or "Extended GMap".

For each view you create that uses a GMap format, you may either use a custom
configuration or inherit the site-wide defaults. To make an advanced map
configuration, you may type or copy/paste a GMap macro into the "Macro" textarea
at the top of the GMap format configuration settings. See the section on
"Macros" for more information about how to customize the configuration of your
map using these powerful tools. If you don't want a custom configuration for
this view, just leave the default value for the Macro field.

The only other critically important setting when configuring a GMap format in
Views is the "Data Source" field. GMap can accept data from several different
sources, but ultimately it comes down to acquiring a latitude and longitude pair
for each item being displayed in the list. GMap module can acquire the lat/long
pair from any of the following sources:

- Location.module
- Geofield.module
- Geolocation.module
- or a pair of simple text or number fields

If you use the pair of text fields, you must also change your view to use a list
of fields. To do this, under the "Format" section of the view configuration,
click on the current row display style (usually the word "Content") and change
it to "Fields". Then under the "Fields" section of the view configuration, add
the fields you're using to store the latitude and longitude (they must be two
separate fields). It may be a good idea to use the "Exclude from display" option
on each of these fields, so they aren't shown in the actual GMap marker popups.


Macros
------
"GMap macros" are text-based representations of Google Maps. A GMap macro can be
created with the GMap Macro Builder tool or by hand. Any map parameter not
specified by a macro will use the defaults from the GMap settings page
(Administer > Site configuration > Web services > GMap). There are several
places where you may use Gmap macros, including:

1) GMap settings, like the GMap Location module's settings page.
2) Any node where the GMap filter is enabled (as part of the text format).

A GMap macro will look something like this (see the advanced help pages (or the
files in help/ in the module folder) for syntax details):
[gmap markers=blue::41.902277040963696,-87.6708984375 |zoom=5 |center=42.94033923363183,-88.857421875 |width=300px |height=200px |control=Small |type=Map]

The GMap Macro Builder is a GUI for creating GMap macros; you may use it to
create a map with points, lines, polygons, and circles, and then copy and paste
the resulting macro text. After you insert the macro into a node, you can edit
it using raw values that you get from elsewhere to create a different set of
points or lines on the map.

If you've enabled the gmap_macro_builder.module, you can access the GMap macro
builder at the 'map/macro' path (there will be "Build a GMap macro" link in your
Navigation menu).

Note that there are many more options you can set on your maps if you are
willing to edit macros by hand. For example, you may add KML or GeoRSS overlays
to GMaps, but this option isn't available through the macro builder. Again, see
the advanced help pages for syntax details.


User and node maps
------------------

User and node location maps are made available by gmap_location.module, and work
in conjunction with location.module. Any user that has the 'view user map' or
'view node map' permission can see the user or node maps, respectively. These
are maps with a marker for every user or node, and are located at the 'map/user'
and 'map/node' paths (links to these maps are placed in the Navigation menu).

Users with the 'view user location details' permission can click markers on the
User map to see information on individual users.

GMap Location also provides two map blocks that work with node locations: a
"Location map" block that displays the location markers associated with the node
being viewed, and an "Author map" block that displays a marker representing the
node author's location.

GMap Location provides an interactive Google Map to the Location module for
setting the latitude and longitude; users must have Location's
"submit latitude/longitude" to use this feature.

Markers
-------

The 'markers' directory contains many useful markers, and you can add custom
markers by placing PNG files (markers must be in PNG format) in the markers
directory and creating a ".ini" file for them. Use the existing .ini files as a
guide--start with "markers/colors.ini".

Support
-------
For feature requests and bug reports, please file an issue in the GMap module
issue tracker at http://drupal.org/project/issues/gmap

File

README.txt
View source
  1. GMap Module
  2. ===========
  3. GMap is an API and a related set of modules which allows the integration of
  4. Google Maps with a Drupal site.
  5. gmap.module: The main module. Contains the API, the basic map functions, Views
  6. integration and an text filter to create macros into working maps with minimal
  7. effort.
  8. gmap_location.module: Provides map features for Location.module (v2 and v3).
  9. gmap_macro_builder.module: End-user UI for easily creating GMap macros.
  10. gmap_taxonomy.module: API and utility for changing map markers of for points
  11. from Location.module based on taxonomy terms.
  12. Installation
  13. ------------
  14. To install, follow the general directions available at:
  15. https://drupal.org/documentation/install/modules-themes
  16. In order to use this module, you need a (free) Google Maps API key. Here is how
  17. to get one:
  18. 1. Login using a Google account to https://code.google.com/apis/console
  19. 2. Create project
  20. 3. Go to 'Services' and turn on 'Google Maps API v2' and 'Google Maps API v3'.
  21. 4. Go to 'API Access' and copy the API Key from the "Simple API Access" section.
  22. 5. Paste the API Key into the GMap settings page at admin/config/services/gmap.
  23. You may need to make changes to your theme so that Google Maps can display
  24. correctly. See the section on "Google Maps and Quirks Mode" below.
  25. If you would like to use GMap macros directly in nodes, you will need to add
  26. the GMap Macro filter to an text format (or create a new text format that
  27. includes it). Read http://drupal.org/node/213156 for more information on text
  28. formats.
  29. If you are using the HTML filter, it will need to appear BEFORE the GMap filter;
  30. otherwise the HTML filter will remove the GMap code. To modify the order of
  31. filters in an text format, go to the "Rearrange" tab on the text format's
  32. configuration page (Administer > Configuration > Content authoring > Text
  33. formats, then click "configure" by your format).
  34. If you would like to use third party functionality such as custom marker
  35. libraries read thirdparty/README.txt for download links and instructions.
  36. If you are translating this module to a different language also see the
  37. gmap.strings.php file for further installation instructions. This is required
  38. for translation of marker type strings to work.
  39. Google Maps and Quirks Mode
  40. ---------------------------
  41. Google Maps may have rendering issues when a doctype is not declared on your
  42. site. Specifically, Google Maps will have problems when the browser is using
  43. "quirks mode". To render pages in "standards compliant mode", use either an
  44. HTML5 doctype or XHTML Strict doctype as the first line of your HTML:
  45. HTML5 doctype:
  46. XHTML Strict doctype:
  47. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  48. Views Integration
  49. -----------------
  50. The GMap module includes built-in integration with the Views module. You can use
  51. this to turn any list of nodes, users, or other content into a Google Map that
  52. plots each item on a map.
  53. To make a GMap-based view, create or edit a view under Administer > Structure >
  54. Views. Under the "Format" section, change the format by clicking on the current
  55. format type (usually "Unformatted list"). Then change the format type to either
  56. "GMap" or "Extended GMap".
  57. For each view you create that uses a GMap format, you may either use a custom
  58. configuration or inherit the site-wide defaults. To make an advanced map
  59. configuration, you may type or copy/paste a GMap macro into the "Macro" textarea
  60. at the top of the GMap format configuration settings. See the section on
  61. "Macros" for more information about how to customize the configuration of your
  62. map using these powerful tools. If you don't want a custom configuration for
  63. this view, just leave the default value for the Macro field.
  64. The only other critically important setting when configuring a GMap format in
  65. Views is the "Data Source" field. GMap can accept data from several different
  66. sources, but ultimately it comes down to acquiring a latitude and longitude pair
  67. for each item being displayed in the list. GMap module can acquire the lat/long
  68. pair from any of the following sources:
  69. - Location.module
  70. - Geofield.module
  71. - Geolocation.module
  72. - or a pair of simple text or number fields
  73. If you use the pair of text fields, you must also change your view to use a list
  74. of fields. To do this, under the "Format" section of the view configuration,
  75. click on the current row display style (usually the word "Content") and change
  76. it to "Fields". Then under the "Fields" section of the view configuration, add
  77. the fields you're using to store the latitude and longitude (they must be two
  78. separate fields). It may be a good idea to use the "Exclude from display" option
  79. on each of these fields, so they aren't shown in the actual GMap marker popups.
  80. Macros
  81. ------
  82. "GMap macros" are text-based representations of Google Maps. A GMap macro can be
  83. created with the GMap Macro Builder tool or by hand. Any map parameter not
  84. specified by a macro will use the defaults from the GMap settings page
  85. (Administer > Site configuration > Web services > GMap). There are several
  86. places where you may use Gmap macros, including:
  87. 1) GMap settings, like the GMap Location module's settings page.
  88. 2) Any node where the GMap filter is enabled (as part of the text format).
  89. A GMap macro will look something like this (see the advanced help pages (or the
  90. files in help/ in the module folder) for syntax details):
  91. [gmap markers=blue::41.902277040963696,-87.6708984375 |zoom=5 |center=42.94033923363183,-88.857421875 |width=300px |height=200px |control=Small |type=Map]
  92. The GMap Macro Builder is a GUI for creating GMap macros; you may use it to
  93. create a map with points, lines, polygons, and circles, and then copy and paste
  94. the resulting macro text. After you insert the macro into a node, you can edit
  95. it using raw values that you get from elsewhere to create a different set of
  96. points or lines on the map.
  97. If you've enabled the gmap_macro_builder.module, you can access the GMap macro
  98. builder at the 'map/macro' path (there will be "Build a GMap macro" link in your
  99. Navigation menu).
  100. Note that there are many more options you can set on your maps if you are
  101. willing to edit macros by hand. For example, you may add KML or GeoRSS overlays
  102. to GMaps, but this option isn't available through the macro builder. Again, see
  103. the advanced help pages for syntax details.
  104. User and node maps
  105. ------------------
  106. User and node location maps are made available by gmap_location.module, and work
  107. in conjunction with location.module. Any user that has the 'view user map' or
  108. 'view node map' permission can see the user or node maps, respectively. These
  109. are maps with a marker for every user or node, and are located at the 'map/user'
  110. and 'map/node' paths (links to these maps are placed in the Navigation menu).
  111. Users with the 'view user location details' permission can click markers on the
  112. User map to see information on individual users.
  113. GMap Location also provides two map blocks that work with node locations: a
  114. "Location map" block that displays the location markers associated with the node
  115. being viewed, and an "Author map" block that displays a marker representing the
  116. node author's location.
  117. GMap Location provides an interactive Google Map to the Location module for
  118. setting the latitude and longitude; users must have Location's
  119. "submit latitude/longitude" to use this feature.
  120. Markers
  121. -------
  122. The 'markers' directory contains many useful markers, and you can add custom
  123. markers by placing PNG files (markers must be in PNG format) in the markers
  124. directory and creating a ".ini" file for them. Use the existing .ini files as a
  125. guide--start with "markers/colors.ini".
  126. Support
  127. -------
  128. For feature requests and bug reports, please file an issue in the GMap module
  129. issue tracker at http://drupal.org/project/issues/gmap