You are here

README.txt in Get Locations 7

for Drupal 7

Getlocations 1.x

Getlocations will provide a Google maps API version 3 enabled map on which to
display markers of locations found in location-enabled content-types.

INSTALL
Before installing getlocations please ensure that you have the libraries module installed

You can fetch markers from dropbox:
As tarballs:
https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers.tar.gz (required)
https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-extra.tar.gz
https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-various.tar.gz
https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-various-small.tar.gz
https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-restaurants-bars.tar.gz
https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-hairlines.tar.gz
https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-circular.tar.gz
https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-micons.tar.gz
https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-paddle.tar.gz

As zipfiles:
https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers.zip (required)
https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-extra.zip
https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-various.zip
https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-various-small.zip
https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-restaurants-bars.zip
https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-hairlines.zip
https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-circular.zip
https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-micons.zip
https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-paddle.zip

Download the file(s) and place them into your libraries folder so you have
a path something like this:
sites/all/libraries/getlocations/markers

The 'extra' files contain numbered and letter markers.
You can optionally add these if you need them.

CONFIGURE
You should configure Getlocations by visiting admin/config/services/getlocations.

USAGE
Getlocations maps can be displayed per node, eg "/getlocations/node/xxx"
will display all the locations associated with that node.

They can also be displayed per content-type, so if your content-type
has a machine name 'venue' you can show them all with
"/getlocations/type/venue".

With the above path you can add another two parameters which must be a
location key/value pair, so "/getlocations/type/venue/city/london" will
give you all the locations in London. The keys might typically be

lid
name
street
additional
city
province
postal_code
country
latitude
longitude
province_name
country_name

If you need more complex things use Views.

TODO
add location-enabled user ids once location handles users properly

You can display a list of location ids with something like
"getlocations/lids/1,2,3,4"
and a list of nodes with
"getlocations/nids/1,2,3,4"

There are some Views, disabled by default.
The getlocations View will provide a block that will appear when a location
enabled node is being shown. The block contains a link to a map.


Automatic Panning
This setting has 4 possibilities:
"None" is No panning.
This uses the default zoom and map center.

"Pan" keeps the markers in the Viewport.
This will try to fit the markers in by panning to them but uses
the default zoom.

"Pan and zoom" fits the markers to the Viewport.
This zooms in as far as it can and will fit all the markers onto the map.
This setting should only be used if you have less than 30 - 50 markers.

"Set Center" places the markers in the middle of the map.
This is similar to "Pan" but uses averaging to define the map center.


Which of these settings is best for your usecase depends on how many markers
you have and their 'spread', eg are they all in one region or spread out all
over the world.

Showing more than 30 -50 markers could lead to browser crash, remember that
it is the client browser not the server that is doing the work so you need to
test on slow machines and basic handheld devices to determine the best
settings for your site.

If you have many markers you can use MarkerClusterer to control your markers.
There is also a Markermanager but it is not as reliable.

If you have the Colorbox module installed and enabled in Get Locations
you can place any of the above paths in a colorbox iframe by replacing
'getlocations' with 'getlocations_box'.
To enable this for a link you can use the 'colorbox-load' method,
make sure that this feature has been enabled in colorbox
and use a url like this:
<a href="/getlocations_box/node/xxx?width=700&height=600&iframe=true" class="colorbox-load">See map</a>

or (advanced use) by adding rel="getlocationsbox" to the url, eg
<a href="/getlocations_box/node/xxx" rel="getlocationsbox">See map</a>

The last method uses the settings in admin/config/services/getlocations for
colorbox and uses its own colorbox event handler, see getlocations_colorbox.js.
You can define your own event handlers in your theme's javascript.
'getlocations_box' has it's own template, getlocations_box.tpl.php which can be
copied over to your theme's folder and tweaked there.

The InfoBubble javascript library is included and can be configured by copying
js/infobubble_options.txt to js/infobubble_options.js and editing that.

Getlocations now has hook_getlocations_markerdir()
from jhm http://drupal.org/user/15946
This hook allows other modules to add their own marker collections.
example:

function mymodule_getlocations_markerdir() {
  $markers = drupal_get_path('module', 'mymodule') . '/mymarkers';
  return $markers;
}

The above example requires the module mymodule to have a folder
mymodule/mymarkers which contains the bespoke markersets.
These will be added to the available markers when the
Marker Cache is regenerated.

In a Getlocations View, in Format: Getlocations | Settings,
if you have selected InfoBubble or InfoWindow in the Marker action dropdown
you will see a checkbox 'Replace default content' which when checked will
provide a list of available fields to use instead of the default content.

Geofield and Geolocation support
Getlocations provides some default Views to work with the
Geofield and Geolocation modules but if you want maps you will have to do
some tweaking.

Geofield:
In the Getlocations view, add a block and in 'Fields'
add Content: Location (or whatever you called it),
Select Formatter: Latitude only
Select Data options: Use full geometry
Select Format: decimal degrees
Under 'More' give it an Administrative title of 'latitude'

Repeat for longitude

Then add Content: Type
You should now have the following in Fields:
Content: Title
Content: Nid (make sure this has 'Rewrite the output of this field' and 'Output this field as a link' switched off)
latitude
longitude
Content: Type (set to Output machine name)

They should be in that order.
exclude all from display except Content: Nid

Then add to Filter criteria
Content: Type and select the content type(s) you want

Under Format: select Getlocations and set up the map
Edit the Block title to whatever suits you
Save the view, enable the block and test.

You can do much the same in 'Getlocations links' View

Geolocation:
In the Getlocations view, add a block and in 'Fields'
add Content: Location (or whatever you called it),
Select Formatter: Latitude text-based formatter
Under 'More' give it an Administrative title of 'latitude'

Repeat for longitude

Then add Content: Type
You should now have the following in Fields:
Content: Title
Content: Nid (make sure this has 'Rewrite the output of this field' and 'Output this field as a link' switched off)
latitude
longitude
Content: Type

They should be in that order.
exclude all from display except Content: Nid

Then add to Filter criteria
Content: Type and select the content type(s) you want

Under Format: select Getlocations and set up the map
Edit the Block title to whatever suits you
Save the view, enable the block and test.

You can do much the same in 'Getlocations links' View

Addressfield support.
If the Addressfield module is supplying an address in conjunction with Geofield or Geolocation
the address will be used to populate the InfoWindow or InfoBubble.

Theming.
Getlocations pages can be themed by copying the relevant function to your theme's template.php,
renaming it in the usual manner.
eg
theme_getlocations_adinfo() becomes MYTHEME_getlocations_adinfo() where MYTHEME is the name of your theme.
You can edit it there to suit your needs.

These functions can be found in the file getlocations.module

Theming the content of InfoWindow or InfoBubble.
This is done with function theme_getlocations_adinfo()

Theming the map display.
This is done with function theme_getlocations_show()

Theming the Getlocations settings form.
This is done with function theme_getlocations_settings_form()

Theming the Getlocations options form in Views.
This is done with function theme_getlocations_plugin_style_map_options_form()

function template_preprocess_getlocations_box() and
function template_preprocess_getlocations_marker_box() are for use in conjunction
with the colorbox module and use the files getlocations_box.tpl.php and
getlocations_marker_box.tpl.php respectively.

You can now categorise markers in Views by adding Content: type (output machine name)
in the Fields section of a view. This will be passed on to the javascript, so you can add a button
to getlocations-view-map.tpl.php (by copying this file to your theme folder)
eg
<p><input type="button" value="Location off" id="toggle_loc"></p>

and adding something like:

      // toggle location button
      if ($("#toggle_loc").is("input")) {
        $("#toggle_loc").click( function() {
          k = 'key_1';
          cat = 'location';
          $.each(getlocations_markers[k].lids, function (lid, mark) {
            if (getlocations_markers[k].cat[lid] == cat) {
              vis = mark.getVisible();
              if (vis) {
                mark.setVisible(false);
                $("#toggle_loc").val("Location on");
              }
              else {
                mark.setVisible(true);
                $("#toggle_loc").val("Location off");
              }
            }
          });
        });
      }

to your theme's javascript
edit 'key_1' to whichever key your map is using
edit 'location' to the machine name of your content type
This will give you a button that can switch markers on/off


More information on theming can be found on http://drupal.org/documentation/theme

Polygons
To use polygons on your map you will need to enable the feature either globally
under admin/config/services/getlocations or per content type under Manage Display or
per map in a View under Format: Getlocations | Settings.
You will need to supply coordinates as a pipe (|) delimited list of lat,lon pairs
minimum 3 pairs.
eg
51.501579,-0.193544|51.498373,-0.144449|51.479882,-0.148054|51.484585,-0.184446

You can also have per polygon settings, here is a list of available options:
strokeColor       eg #0000FF
strokeOpacity     between 0 and 1
strokeWeight      eg 3
fillColor         eg #0000FF
fillOpacity       between 0 and 1
clickable         1 or 0
message           any text

These should be in the form of key:value
eg
strokeColor:#0000FF

You should add these to the pipe delimited list, eg

strokeColor:#0000FF|strokeOpacity:0.8|51.501579,-0.193544|51.498373,-0.144449|51.479882,-0.148054|51.484585,-0.184446

GeoJSON
Getlocations can support GeoJSON objects, see http://www.geojson.org/ for information about this format.
You can download the library from https://github.com/JasonSanford/GeoJSON-to-Google-Maps.
It should be installed in your libraries folder so you have a path something like this:
sites/all/libraries/GeoJSON/GeoJSON.js

Once the library is installed you can enable it globally, per view or per content type

Geocoder-js
The geocoder-js library provides support for the search facilities from Openstreetmap
You can download the library from https://github.com/geocoder-php/geocoder-js.
You should copy the file from dist/geocoder.min.js to sites/all/libraries/geocoder-js/geocoder.min.js

Once the library is installed you can enable it globally, per content type or in getlocations_search.

Drush integration for getlocations.
'drush getlocations-markers' will install the basic getlocations marker set
'drush getlocations-geojson' will install the GeoJSON javascript library
'drush getlocations-geocoder' will install the Geocoder-js javascript library
'drush getlocations-leaflet'  will install the Leaflet javascript library
If you want the library installed somewhere other than sites/all/libraries then provide the path after the command.

Other map tiles.
Getlocations supports the use of other sources of maps besides Google, you can show maps from OpenStreetMap, OpenCycleMap, Stamen and Esri.
Developers can add their own maps using hook_getlocations_map_providers(), see the function getlocations_getlocations_map_providers() for examples.

The Google Places Search service can be enabled for any map. It can be configured to provide an Autocomplete textfield or a dropdown.
If you want to preselect a particular item in the dropdown you can add something like this to your theme's javascript:

var key = 'key_1';
var tp = 'grocery_or_supermarket';
$("#search_places_select_" + key).val(tp);

Content type Markers
If you have selected "Enable Markers for Content types" in admin/config/services/getlocations
and you wish to use these markers in a View you need to ensure that you have enabled

Getlocations Fields: Field name
Content: Type (set to Output machine name)

in the view's Fields list

File

README.txt
View source
  1. for Drupal 7
  2. Getlocations 1.x
  3. Getlocations will provide a Google maps API version 3 enabled map on which to
  4. display markers of locations found in location-enabled content-types.
  5. INSTALL
  6. Before installing getlocations please ensure that you have the libraries module installed
  7. You can fetch markers from dropbox:
  8. As tarballs:
  9. https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers.tar.gz (required)
  10. https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-extra.tar.gz
  11. https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-various.tar.gz
  12. https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-various-small.tar.gz
  13. https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-restaurants-bars.tar.gz
  14. https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-hairlines.tar.gz
  15. https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-circular.tar.gz
  16. https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-micons.tar.gz
  17. https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-paddle.tar.gz
  18. As zipfiles:
  19. https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers.zip (required)
  20. https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-extra.zip
  21. https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-various.zip
  22. https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-various-small.zip
  23. https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-restaurants-bars.zip
  24. https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-hairlines.zip
  25. https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-circular.zip
  26. https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-micons.zip
  27. https://dl.dropboxusercontent.com/u/41489105/Drupal/getlocations/getlocations-markers-paddle.zip
  28. Download the file(s) and place them into your libraries folder so you have
  29. a path something like this:
  30. sites/all/libraries/getlocations/markers
  31. The 'extra' files contain numbered and letter markers.
  32. You can optionally add these if you need them.
  33. CONFIGURE
  34. You should configure Getlocations by visiting admin/config/services/getlocations.
  35. USAGE
  36. Getlocations maps can be displayed per node, eg "/getlocations/node/xxx"
  37. will display all the locations associated with that node.
  38. They can also be displayed per content-type, so if your content-type
  39. has a machine name 'venue' you can show them all with
  40. "/getlocations/type/venue".
  41. With the above path you can add another two parameters which must be a
  42. location key/value pair, so "/getlocations/type/venue/city/london" will
  43. give you all the locations in London. The keys might typically be
  44. lid
  45. name
  46. street
  47. additional
  48. city
  49. province
  50. postal_code
  51. country
  52. latitude
  53. longitude
  54. province_name
  55. country_name
  56. If you need more complex things use Views.
  57. TODO
  58. add location-enabled user ids once location handles users properly
  59. You can display a list of location ids with something like
  60. "getlocations/lids/1,2,3,4"
  61. and a list of nodes with
  62. "getlocations/nids/1,2,3,4"
  63. There are some Views, disabled by default.
  64. The getlocations View will provide a block that will appear when a location
  65. enabled node is being shown. The block contains a link to a map.
  66. Automatic Panning
  67. This setting has 4 possibilities:
  68. "None" is No panning.
  69. This uses the default zoom and map center.
  70. "Pan" keeps the markers in the Viewport.
  71. This will try to fit the markers in by panning to them but uses
  72. the default zoom.
  73. "Pan and zoom" fits the markers to the Viewport.
  74. This zooms in as far as it can and will fit all the markers onto the map.
  75. This setting should only be used if you have less than 30 - 50 markers.
  76. "Set Center" places the markers in the middle of the map.
  77. This is similar to "Pan" but uses averaging to define the map center.
  78. Which of these settings is best for your usecase depends on how many markers
  79. you have and their 'spread', eg are they all in one region or spread out all
  80. over the world.
  81. Showing more than 30 -50 markers could lead to browser crash, remember that
  82. it is the client browser not the server that is doing the work so you need to
  83. test on slow machines and basic handheld devices to determine the best
  84. settings for your site.
  85. If you have many markers you can use MarkerClusterer to control your markers.
  86. There is also a Markermanager but it is not as reliable.
  87. If you have the Colorbox module installed and enabled in Get Locations
  88. you can place any of the above paths in a colorbox iframe by replacing
  89. 'getlocations' with 'getlocations_box'.
  90. To enable this for a link you can use the 'colorbox-load' method,
  91. make sure that this feature has been enabled in colorbox
  92. and use a url like this:
  93. See map
  94. or (advanced use) by adding rel="getlocationsbox" to the url, eg
  95. See map
  96. The last method uses the settings in admin/config/services/getlocations for
  97. colorbox and uses its own colorbox event handler, see getlocations_colorbox.js.
  98. You can define your own event handlers in your theme's javascript.
  99. 'getlocations_box' has it's own template, getlocations_box.tpl.php which can be
  100. copied over to your theme's folder and tweaked there.
  101. The InfoBubble javascript library is included and can be configured by copying
  102. js/infobubble_options.txt to js/infobubble_options.js and editing that.
  103. Getlocations now has hook_getlocations_markerdir()
  104. from jhm http://drupal.org/user/15946
  105. This hook allows other modules to add their own marker collections.
  106. example:
  107. function mymodule_getlocations_markerdir() {
  108. $markers = drupal_get_path('module', 'mymodule') . '/mymarkers';
  109. return $markers;
  110. }
  111. The above example requires the module mymodule to have a folder
  112. mymodule/mymarkers which contains the bespoke markersets.
  113. These will be added to the available markers when the
  114. Marker Cache is regenerated.
  115. In a Getlocations View, in Format: Getlocations | Settings,
  116. if you have selected InfoBubble or InfoWindow in the Marker action dropdown
  117. you will see a checkbox 'Replace default content' which when checked will
  118. provide a list of available fields to use instead of the default content.
  119. Geofield and Geolocation support
  120. Getlocations provides some default Views to work with the
  121. Geofield and Geolocation modules but if you want maps you will have to do
  122. some tweaking.
  123. Geofield:
  124. In the Getlocations view, add a block and in 'Fields'
  125. add Content: Location (or whatever you called it),
  126. Select Formatter: Latitude only
  127. Select Data options: Use full geometry
  128. Select Format: decimal degrees
  129. Under 'More' give it an Administrative title of 'latitude'
  130. Repeat for longitude
  131. Then add Content: Type
  132. You should now have the following in Fields:
  133. Content: Title
  134. Content: Nid (make sure this has 'Rewrite the output of this field' and 'Output this field as a link' switched off)
  135. latitude
  136. longitude
  137. Content: Type (set to Output machine name)
  138. They should be in that order.
  139. exclude all from display except Content: Nid
  140. Then add to Filter criteria
  141. Content: Type and select the content type(s) you want
  142. Under Format: select Getlocations and set up the map
  143. Edit the Block title to whatever suits you
  144. Save the view, enable the block and test.
  145. You can do much the same in 'Getlocations links' View
  146. Geolocation:
  147. In the Getlocations view, add a block and in 'Fields'
  148. add Content: Location (or whatever you called it),
  149. Select Formatter: Latitude text-based formatter
  150. Under 'More' give it an Administrative title of 'latitude'
  151. Repeat for longitude
  152. Then add Content: Type
  153. You should now have the following in Fields:
  154. Content: Title
  155. Content: Nid (make sure this has 'Rewrite the output of this field' and 'Output this field as a link' switched off)
  156. latitude
  157. longitude
  158. Content: Type
  159. They should be in that order.
  160. exclude all from display except Content: Nid
  161. Then add to Filter criteria
  162. Content: Type and select the content type(s) you want
  163. Under Format: select Getlocations and set up the map
  164. Edit the Block title to whatever suits you
  165. Save the view, enable the block and test.
  166. You can do much the same in 'Getlocations links' View
  167. Addressfield support.
  168. If the Addressfield module is supplying an address in conjunction with Geofield or Geolocation
  169. the address will be used to populate the InfoWindow or InfoBubble.
  170. Theming.
  171. Getlocations pages can be themed by copying the relevant function to your theme's template.php,
  172. renaming it in the usual manner.
  173. eg
  174. theme_getlocations_adinfo() becomes MYTHEME_getlocations_adinfo() where MYTHEME is the name of your theme.
  175. You can edit it there to suit your needs.
  176. These functions can be found in the file getlocations.module
  177. Theming the content of InfoWindow or InfoBubble.
  178. This is done with function theme_getlocations_adinfo()
  179. Theming the map display.
  180. This is done with function theme_getlocations_show()
  181. Theming the Getlocations settings form.
  182. This is done with function theme_getlocations_settings_form()
  183. Theming the Getlocations options form in Views.
  184. This is done with function theme_getlocations_plugin_style_map_options_form()
  185. function template_preprocess_getlocations_box() and
  186. function template_preprocess_getlocations_marker_box() are for use in conjunction
  187. with the colorbox module and use the files getlocations_box.tpl.php and
  188. getlocations_marker_box.tpl.php respectively.
  189. You can now categorise markers in Views by adding Content: type (output machine name)
  190. in the Fields section of a view. This will be passed on to the javascript, so you can add a button
  191. to getlocations-view-map.tpl.php (by copying this file to your theme folder)
  192. eg
  193. and adding something like:
  194. // toggle location button
  195. if ($("#toggle_loc").is("input")) {
  196. $("#toggle_loc").click( function() {
  197. k = 'key_1';
  198. cat = 'location';
  199. $.each(getlocations_markers[k].lids, function (lid, mark) {
  200. if (getlocations_markers[k].cat[lid] == cat) {
  201. vis = mark.getVisible();
  202. if (vis) {
  203. mark.setVisible(false);
  204. $("#toggle_loc").val("Location on");
  205. }
  206. else {
  207. mark.setVisible(true);
  208. $("#toggle_loc").val("Location off");
  209. }
  210. }
  211. });
  212. });
  213. }
  214. to your theme's javascript
  215. edit 'key_1' to whichever key your map is using
  216. edit 'location' to the machine name of your content type
  217. This will give you a button that can switch markers on/off
  218. More information on theming can be found on http://drupal.org/documentation/theme
  219. Polygons
  220. To use polygons on your map you will need to enable the feature either globally
  221. under admin/config/services/getlocations or per content type under Manage Display or
  222. per map in a View under Format: Getlocations | Settings.
  223. You will need to supply coordinates as a pipe (|) delimited list of lat,lon pairs
  224. minimum 3 pairs.
  225. eg
  226. 51.501579,-0.193544|51.498373,-0.144449|51.479882,-0.148054|51.484585,-0.184446
  227. You can also have per polygon settings, here is a list of available options:
  228. strokeColor eg #0000FF
  229. strokeOpacity between 0 and 1
  230. strokeWeight eg 3
  231. fillColor eg #0000FF
  232. fillOpacity between 0 and 1
  233. clickable 1 or 0
  234. message any text
  235. These should be in the form of key:value
  236. eg
  237. strokeColor:#0000FF
  238. You should add these to the pipe delimited list, eg
  239. strokeColor:#0000FF|strokeOpacity:0.8|51.501579,-0.193544|51.498373,-0.144449|51.479882,-0.148054|51.484585,-0.184446
  240. GeoJSON
  241. Getlocations can support GeoJSON objects, see http://www.geojson.org/ for information about this format.
  242. You can download the library from https://github.com/JasonSanford/GeoJSON-to-Google-Maps.
  243. It should be installed in your libraries folder so you have a path something like this:
  244. sites/all/libraries/GeoJSON/GeoJSON.js
  245. Once the library is installed you can enable it globally, per view or per content type
  246. Geocoder-js
  247. The geocoder-js library provides support for the search facilities from Openstreetmap
  248. You can download the library from https://github.com/geocoder-php/geocoder-js.
  249. You should copy the file from dist/geocoder.min.js to sites/all/libraries/geocoder-js/geocoder.min.js
  250. Once the library is installed you can enable it globally, per content type or in getlocations_search.
  251. Drush integration for getlocations.
  252. 'drush getlocations-markers' will install the basic getlocations marker set
  253. 'drush getlocations-geojson' will install the GeoJSON javascript library
  254. 'drush getlocations-geocoder' will install the Geocoder-js javascript library
  255. 'drush getlocations-leaflet' will install the Leaflet javascript library
  256. If you want the library installed somewhere other than sites/all/libraries then provide the path after the command.
  257. Other map tiles.
  258. Getlocations supports the use of other sources of maps besides Google, you can show maps from OpenStreetMap, OpenCycleMap, Stamen and Esri.
  259. Developers can add their own maps using hook_getlocations_map_providers(), see the function getlocations_getlocations_map_providers() for examples.
  260. The Google Places Search service can be enabled for any map. It can be configured to provide an Autocomplete textfield or a dropdown.
  261. If you want to preselect a particular item in the dropdown you can add something like this to your theme's javascript:
  262. var key = 'key_1';
  263. var tp = 'grocery_or_supermarket';
  264. $("#search_places_select_" + key).val(tp);
  265. Content type Markers
  266. If you have selected "Enable Markers for Content types" in admin/config/services/getlocations
  267. and you wish to use these markers in a View you need to ensure that you have enabled
  268. Getlocations Fields: Field name
  269. Content: Type (set to Output machine name)
  270. in the view's Fields list