Commit c187fb03 authored by Michael McAndrew's avatar Michael McAndrew
Browse files

updating gmap, views_accordion and location drupal modules

parent ea4e6760
#.gitignore
*.patch
*.diff
.idea
This diff is collapsed.
$Id: NOTES.txt,v 1.2 2008/07/15 16:30:29 bdragon Exp $
General notes for getting the most out of gmap.
......
$Id: README.txt,v 1.13.2.1 2010/06/13 08:50:02 rooby Exp $
Description
-----------
......@@ -21,9 +20,13 @@ Installation
* To install, follow the general directions available at:
http://drupal.org/getting-started/5/install-contrib/modules
* You will need a Google Maps API key for your website. You can get one at:
http://www.google.com/apis/maps/signup.html
Enter your Google Maps API key in the GMap settings page (admin/settings/gmap).
In order to use 7.x-1.x and earlier versions of this module, you need a (free) Google Maps API Browser key. Here is how to get one:
1. Login at https://code.google.com/apis/console
2. Create project
3. Go to 'Services' and turn on 'Google Maps API v2'
4. Go to 'API Access' and 'Create New Browser Key' specifying your domain url(s)
5. Paste the Google API Browser Key here /admin/settings/gmap
* You may need to make changes to your theme so that Google Maps can display correctly. See the section on "Google Maps and XHTML" below.
......@@ -64,14 +67,14 @@ Macro
1) GMap settings, like the GMap Location module's settings page.
2) Any node where the GMap filter is enabled (as part of the input format).
A GMap macro will look something like this (see API.txt for syntax details):
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 API.txt for syntax details.
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
......
$Id: TODO.txt,v 1.4 2008/12/31 19:17:47 bdragon Exp $
Drupal 7 todo:
* Finish porting
* Migration path for people who used private method with markers.
* Fix markermanagers.
Drupal 6 todo:
......
<?php
// $Id: gmap-view-gmap.tpl.php,v 1.1 2008/09/17 22:47:10 bdragon Exp $
/**
* @file gmap-view-gmap.tpl.php
* Default view template for a gmap.
......
/* $Id: gmap.css,v 1.7.2.1 2010/04/08 13:40:19 rooby Exp $ */
/**
* @file
......@@ -41,3 +40,33 @@
.gmap-map .gmnoprint tbody {
border-top: none;
}
.gmap-custom-control-button {
position: absolute;
background-color: white;
border: 1px solid black;
text-align: center;
width: 5em;
cursor: pointer;
}
.gmap-custom-control-button div {
font-size: 12px;
border-width: 1px;
border-style: solid;
border-color: white rgb(176, 176, 176) rgb(176, 176, 176) white;
}
.gmap-custom-control-button-disabled {
color: grey;
}
/* IE and FF will display the map as a grey box if max-width is set to 100% for img tag within .gmap. */
.view-gmap img,
.openlayers-map img,
.YMaps img,
.gmap img,
#getlocations_map_canvas img {
max-width: none !important;
}
; $Id: gmap.info,v 1.3 2008/07/15 17:19:33 bdragon Exp $
name = GMap
description = Filter to allow insertion of a google map into a node
core = 6.x
description = Views plugins to show Google Maps from entities.
core = 7.x
package = Location
configure = admin/config/services/gmap
; Information added by drupal.org packaging script on 2010-07-06
version = "6.x-1.1"
core = "6.x"
files[] = gmap_plugin_style_gmap.inc
files[] = gmap_plugin_style_gmapextended.inc
files[] = tests/gmap.test
; Information added by drupal.org packaging script on 2013-03-31
version = "7.x-2.6"
core = "7.x"
project = "gmap"
datestamp = "1278426618"
datestamp = "1364754012"
<?php
// $Id: gmap.install,v 1.5.2.1 2010/01/10 02:11:02 bdragon Exp $
/**
* @file
......@@ -19,8 +18,7 @@ function gmap_uninstall() {
variable_del('gmap_markerfiles');
variable_del('gmap_node_markers');
variable_del('gmap_private_markerfile');
variable_del('googlemap_api_key');
variable_del('gmap_api_key');
}
/**
......@@ -100,3 +98,15 @@ function gmap_update_5003() {
drupal_set_message(t('Border Padding on marker managers is now defaulting to the recommended 256 pixels, rather than 0 pixels. You may wish to change your marker manager settings on the <a href="@url">GMap settings page</a> to match.', array('@url' => url('admin/settings/gmap'))));
return $ret;
}
/**
* Drupal 7 clean up.
*/
/*
function gmap_update_7000() {
$ret = array();
variable_del('gmap_private_markerfile');
return $ret;
}
*/
This diff is collapsed.
<?php
// $Id: gmap.php,v 1.2.2.1 2010/01/09 22:03:36 bdragon Exp $
/**
* @file
......
<?php
// $Id: gmap.strings.inc,v 1.1.2.1 2010/06/13 08:50:02 rooby Exp $
/**
* @file
* Translation definitions for builtin data.
*/
function gmap_marker_labels_potx() {
$marker_labels = array(
......
<?php
// $Id: gmap.strings.php,v 1.1.2.1 2010/06/13 08:50:02 rooby Exp $
/**
* gmap.strings.php
*
......
<?php
// $Id: gmap.views.inc,v 1.1 2008/09/17 22:47:10 bdragon Exp $
/**
* @file
* GMap views support.
* GMap Views support.
*/
/**
* Implementation of hook_views_handlers().
*/
/*
function gmap_views_handlers() {
return array(
'info' => array(
'path' => drupal_get_path('module', 'gmap'),
),
'handlers' => array(
'gmap_plugin_style_gmap' => array(
'parent' => 'views_plugin_style',
),
),
function theme_gmap_views_view_gmapextended(&$vars) {
$markers = array();
foreach ($vars['markers'] as $offset => $data) {
if (empty($data['latitude']) || empty($data['longitude'])) {
continue;
}
$markers[] = $data;
}
// @@@ Move to preprocess
$map = gmap_parse_macro($vars['options']['macro']);
// If center lon/lat are not empty they are used to center map
if (!empty($vars['center']['longitude']) && !empty($vars['center']['latitude'])) {
$map['longitude'] = $vars['center']['longitude'];
$map['latitude'] = $vars['center']['latitude'];
}
if (!empty($vars['options']['iwq'])) {
$map['iwq'] = $vars['options']['iwq'];
}
$map['markers'] = $markers;
$elem = array(
'#type' => 'gmap',
'#gmap_settings' => $map,
);
return drupal_render($elem);
}
*/
function template_preprocess_gmap_views_view_gmapextended(&$vars) {
$view = $vars['view'];
// We need the raw data for this grouping, which is passed in as $vars['rows'].
// However, the template also needs to use for the rendered fields. We
// therefore swap the raw data out to a new variable and reset $vars['rows']
// so that it can get rebuilt.
// Store rows so that they may be used by further preprocess functions.
$result = $vars['result'] = $vars['rows'];
$vars['rows'] = array();
$options = $view->style_plugin->options;
$handler = $view->style_plugin;
$fields = &$view->field;
if ($view->style_plugin->options['center_on_proximityfilter'] && $view->style_plugin->options['datasource'] == 'location' && module_exists('location')) {
$vars['center'] = location_views_proximity_get_reference_location($view, array(
'origin' => 'tied',
'relationship' => $view->style_plugin->options['center_on_proximityfilter_rel'])
);
}
// Render fields.
$renders = $handler->render_fields($result);
$markers = array();
// File away fields into the marker data.
foreach ($renders as $i => $row) {
$markers[$i] = $options['fallback_values'];
foreach ($options['field_purposes'] as $field => $purpose) {
if (!isset($markers[$i][$purpose])) {
$markers[$i][$purpose] = '';
}
$markers[$i][$purpose] .= $row[$field];
}
}
/*
foreach ($options['field_purposes'] as $field => $purpose) {
foreach ($renders as $i => $row) {
if (!isset($markers[$i][$purpose])) {
$markers[$i][$purpose] = '';
}
$markers[$i][$purpose] .= $row[$field];
}
}
*/
foreach ($markers as $offset => $marker) {
// Set up 'opts' array to make tooltips work
$markers[$offset]['opts'] = array('title' => isset($marker['title']) ? decode_entities($marker['title']) : NULL);
switch ($options['clickmode']) {
case 'render':
$markers[$offset]['text'] = $vars['result'][$offset];
//fallthrough
case 'text':
unset ($markers[$offset]['link']);
unset ($markers[$offset]['rmt']);
unset ($markers[$offset]['iwq']);
unset ($markers[$offset]['iwo']);
break;
case 'rmt':
unset ($markers[$offset]['text']);
unset ($markers[$offset]['link']);
unset ($markers[$offset]['iwq']);
unset ($markers[$offset]['iwo']);
break;
case 'link':
unset ($markers[$offset]['text']);
unset ($markers[$offset]['rmt']);
unset ($markers[$offset]['iwq']);
unset ($markers[$offset]['iwo']);
break;
case 'iwq':
// @@@ May need to parse entities for stuff like .foo>.bar
$markers[$offset]['iwq'] = trim($markers[$offset]['iwq']);
$markers[$offset]['iwo'] = (int)trim($markers[$offset]['iwo']);
if (empty($markers[$offset]['iwq']) || $markers[$offset]['iwq'] == $options['iwq']) {
unset($markers[$offset]['iwq']);
}
unset ($markers[$offset]['text']);
unset ($markers[$offset]['link']);
unset ($markers[$offset]['rmt']);
break;
}
}
// @@@ add rest of handling
/*
if ($options['markers'] == 'static') {
foreach ($markers as $offset => $marker) {
$markers[$offset]['markername'] = $options['markertype'];
}
}
*/
function template_preprocess_gmap_view_gmap(&$vars) {
$vars['map_object'] = $vars['rows'];
// Rows is actually our map object.
unset($vars['rows']);
// Marker cleanup
foreach ($markers as $offset => $marker) {
$marker['latitude'] = isset($marker['latitude']) ? (float)$marker['latitude'] : NULL;
$marker['longitude'] = isset($marker['longitude']) ? (float)$marker['longitude'] : NULL;
}
// Theme the map.
$vars['map'] = theme('gmap', array('#settings' => $vars['map_object']));
$vars['markers'] = $markers;
}
; $Id: gmap_location.info,v 1.3 2008/07/15 18:45:37 bdragon Exp $
name = GMap Location
description = Display location.module information on Google Maps
package = Location
core = 6.x
core = 7.x
configure = admin/config/services/gmap_location
files[] = gmap_location.module
dependencies[] = gmap
dependencies[] = location
; Information added by drupal.org packaging script on 2010-07-06
version = "6.x-1.1"
core = "6.x"
; Information added by drupal.org packaging script on 2013-03-31
version = "7.x-2.6"
core = "7.x"
project = "gmap"
datestamp = "1278426618"
datestamp = "1364754012"
<?php
// $Id: gmap_location.install,v 1.8 2009/03/13 17:10:45 bdragon Exp $
/**
* @file
......@@ -26,7 +25,7 @@ function gmap_location_uninstall() {
variable_del('gmap_location_author_block_types');
variable_del('gmap_location_author_block_marker');
$result = db_query("SELECT name FROM {variable} WHERE name LIKE 'gmap_location_block_macro_%%'");
while ($row = db_fetch_object($result)) {
foreach ($result as $row) {
variable_del($row->name);
}
}
......@@ -128,7 +127,7 @@ function gmap_location_update_5100() {
break;
default:
// User has customized macro.
drupal_set_message(t('You have customized the !type macro. Be advised that the new default macro is %macro. Please check your macro on the <a href="@url">block configuration page</a>.', array('!type' => t('Location block'), '%macro' => '[gmap |width=100% |height=200px |control=None |behavior=+autozoom +notype]', '@url' => url('admin/build/block/configure/gmap_location/0'))));
drupal_set_message(t('You have customized the @type macro. Be advised that the new default macro is %macro. Please check your macro on the <a href="@url">block configuration page</a>.', array('@type' => t('Location block'), '%macro' => '[gmap |width=100% |height=200px |control=None |behavior=+autozoom +notype]', '@url' => url('admin/structure/block/manage/gmap_location/0/configure'))));
}
}
......@@ -147,7 +146,7 @@ function gmap_location_update_5100() {
break;
default:
// User has customized macro.
drupal_set_message(t('You have customized the !type macro. Be advised that the new default macro is %macro. Please check your macro on the <a href="@url">block configuration page</a>.', array('!type' => t('Author block'), '%macro' => '[gmap |width=100% |height=200px |control=None |behavior=+autozoom +notype]', '@url' => url('admin/build/block/configure/gmap_location/1'))));
drupal_set_message(t('You have customized the @type macro. Be advised that the new default macro is %macro. Please check your macro on the <a href="@url">block configuration page</a>.', array('@type' => t('Author block'), '%macro' => '[gmap |width=100% |height=200px |control=None |behavior=+autozoom +notype]', '@url' => url('admin/structure/block/manage/gmap_location/1/configure'))));
}
}
......@@ -170,14 +169,6 @@ function gmap_location_update_5101() {
*/
function gmap_location_update_5102() {
$ret = array();
$result = db_query("SELECT rid, perm FROM {permission} ORDER BY rid");
while ($role = db_fetch_object($result)) {
$renamed_permission = preg_replace('/(?<=^|,\ )user\ locations(?=,|$)/', 'view user location details', $role->perm);
$renamed_permission = preg_replace('/(?<=^|,\ )show\ user\ map(?=,|$)/', 'view user map', $renamed_permission);
$renamed_permission = preg_replace('/(?<=^|,\ )show\ node\ map(?=,|$)/', 'view node map', $renamed_permission);
if ($renamed_permission != $role->perm) {
$ret[] = update_sql("UPDATE {permission} SET perm = '$renamed_permission' WHERE rid = $role->rid");
}
}
drupal_set_message(t('You are upgrading from an ancient GMap version. Please see <a href="@url">this issue</a>.', array('@url' => 'http://drupal.org/node/392130')));
return $ret;
}
This diff is collapsed.
; $Id: gmap_macro_builder.info,v 1.3 2008/07/15 18:09:12 bdragon Exp $
name = GMap Macro Builder
description = UI for building GMap macros.
package = Location
core = 6.x
core = 7.x
dependencies[] = gmap
files[] = gmap_macro_builder.module
; Information added by drupal.org packaging script on 2010-07-06
version = "6.x-1.1"
core = "6.x"
; Information added by drupal.org packaging script on 2013-03-31
version = "7.x-2.6"
core = "7.x"
project = "gmap"
datestamp = "1278426618"
datestamp = "1364754012"
<?php
// $Id: gmap_macro_builder.install,v 1.1 2008/11/24 17:49:55 bdragon Exp $
/**
* @file
......@@ -10,17 +9,6 @@
* Rename 'create macro' permission.
*/
function gmap_macro_builder_update_6100() {
$ret = array();
$result = db_query('SELECT pid, perm FROM {permission}');
while ($row = db_fetch_object($result)) {
// We leave "create macro" in for now just in case someone else already had that permission.
// It should get removed automatically the next time an admin tweaks the permissions.
$permissions = explode(', ', $row->perm);
if (in_array('create macro', $permissions) && !in_array('create gmap macro', $permissions)) {
$permissions[] = 'create gmap macro';
}
$permissions = implode(', ', $permissions);
db_query("UPDATE {permission} SET perm = '%s' WHERE pid = %d", $permissions, $row->pid);
}
return $ret;
// This should not affect too many people.
return t("The 'create macro' permission was renamed to 'Create gmap macro'. You will have to readd the permission to the appropriate roles.");
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment