large world map
Change-Id: I9ceea7522bd32505c853698c2084fa443a4a6ecc
This commit is contained in:
parent
787f8509c8
commit
5ff1c8d404
|
@ -429,6 +429,30 @@ projects[registry_rebuild][version] = "1.10"
|
|||
projects[registry_rebuild][type] = "module"
|
||||
projects[registry_rebuild][subdir] = "contrib"
|
||||
|
||||
projects[geophp][version] = "1.7"
|
||||
projects[geophp][type] = "module"
|
||||
projects[geophp][subdir] = "contrib"
|
||||
|
||||
projects[geocoder][version] = "1.2"
|
||||
projects[geocoder][type] = "module"
|
||||
projects[geocoder][subdir] = "contrib"
|
||||
|
||||
projects[geofield][version] = "2.0"
|
||||
projects[geofield][type] = "module"
|
||||
projects[geofield][subdir] = "contrib"
|
||||
|
||||
projects[leaflet][version] = "1.0-beta3"
|
||||
projects[leaflet][type] = "module"
|
||||
projects[leaflet][subdir] = "contrib"
|
||||
|
||||
projects[leaflet_mapbox][version] = "1.2"
|
||||
projects[leaflet_mapbox][type] = "module"
|
||||
projects[leaflet_mapbox][subdir] = "contrib"
|
||||
|
||||
projects[leaflet_more_maps][version] = "1.6"
|
||||
projects[leaflet_more_maps][type] = "module"
|
||||
projects[leaflet_more_maps][subdir] = "contrib"
|
||||
|
||||
; Contributed themes.
|
||||
|
||||
projects[adaptivetheme][type] = "theme"
|
||||
|
@ -467,3 +491,9 @@ libraries[placeholder][download][url] = "https://github.com/mathiasbynens/jquery
|
|||
libraries[timeago][download][type] = "get"
|
||||
libraries[timeago][type] = "libraries"
|
||||
libraries[timeago][download][url] = "https://raw.github.com/rmm5t/jquery-timeago/v1.3.0/jquery.timeago.js"
|
||||
|
||||
; leaflet module, need to repackage with proper internal directory structure
|
||||
libraries[dist][download][type] = "get"
|
||||
libraries[dist][type] = "libraries"
|
||||
libraries[dist][download][url] = "http://leaflet-cdn.s3.amazonaws.com/build/leaflet-0.6.4.zip"
|
||||
libraries[dist][destination] = "libraries/leaflet"
|
||||
|
|
|
@ -99,6 +99,13 @@ dependencies[] = commons_location
|
|||
dependencies[] = commons_wysiwyg
|
||||
dependencies[] = commons_social_sharing
|
||||
dependencies[] = commons_trusted_contacts
|
||||
dependencies[] = geophp
|
||||
dependencies[] = geocoder
|
||||
dependencies[] = geofield
|
||||
dependencies[] = leaflet
|
||||
dependencies[] = leaflet_views
|
||||
dependencies[] = leaflet_mapbox
|
||||
dependencies[] = leaflet_more_maps
|
||||
|
||||
; Custom modules
|
||||
dependencies[] = field_property_list
|
||||
|
|
|
@ -106,6 +106,10 @@ function field_group_location_field_widget_info() {
|
|||
'label' => t('Field group location'),
|
||||
'field types' => array('field_group_location'),
|
||||
),
|
||||
'geofield_group_location' => array(
|
||||
'label' => t('Geocode from group location field'),
|
||||
'field types' => array('geofield'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -141,6 +145,8 @@ function field_group_location_field_widget_form(&$form, &$form_state, $field,
|
|||
'#description' => 'Enter city, region here.',
|
||||
);
|
||||
break;
|
||||
case 'geofield_group_location':
|
||||
break;
|
||||
}
|
||||
|
||||
return $element + $widget;
|
||||
|
|
|
@ -4,7 +4,8 @@ core = 7.x
|
|||
package = Groups - Landing Pages
|
||||
version = 7.x-1.0
|
||||
project = groups_directory
|
||||
dependencies[] = ctools
|
||||
dependencies[] = leaflet_mapbox
|
||||
dependencies[] = leaflet_more_maps
|
||||
dependencies[] = page_manager
|
||||
dependencies[] = views
|
||||
dependencies[] = views_content
|
||||
|
@ -13,3 +14,5 @@ features[ctools][] = views:views_default:3.0
|
|||
features[features_api][] = api:2
|
||||
features[page_manager_pages][] = groups_directory
|
||||
features[views_view][] = groups_groups_directory
|
||||
features[views_view][] = groups_map
|
||||
features_exclude[dependencies][leaflet_views] = leaflet_views
|
||||
|
|
|
@ -67,6 +67,40 @@ function groups_directory_default_page_manager_pages() {
|
|||
$display->uuid = 'd2985b74-dfbb-8c44-75c5-66561d3f51d9';
|
||||
$display->content = array();
|
||||
$display->panels = array();
|
||||
$pane = new stdClass();
|
||||
$pane->pid = 'new-36c90f7b-8dc4-8454-ad40-eb1a8c79b542';
|
||||
$pane->panel = 'one_main';
|
||||
$pane->type = 'views';
|
||||
$pane->subtype = 'groups_map';
|
||||
$pane->shown = TRUE;
|
||||
$pane->access = array();
|
||||
$pane->configuration = array(
|
||||
'override_pager_settings' => 0,
|
||||
'use_pager' => 1,
|
||||
'nodes_per_page' => '0',
|
||||
'pager_id' => '0',
|
||||
'offset' => '0',
|
||||
'more_link' => 0,
|
||||
'feed_icons' => 0,
|
||||
'panel_args' => 0,
|
||||
'link_to_view' => 0,
|
||||
'args' => '',
|
||||
'url' => '',
|
||||
'display' => 'default',
|
||||
'override_title' => 0,
|
||||
'override_title_text' => '',
|
||||
);
|
||||
$pane->cache = array();
|
||||
$pane->style = array(
|
||||
'settings' => NULL,
|
||||
);
|
||||
$pane->css = array();
|
||||
$pane->extras = array();
|
||||
$pane->position = 0;
|
||||
$pane->locks = array();
|
||||
$pane->uuid = '36c90f7b-8dc4-8454-ad40-eb1a8c79b542';
|
||||
$display->content['new-36c90f7b-8dc4-8454-ad40-eb1a8c79b542'] = $pane;
|
||||
$display->panels['one_main'][0] = 'new-36c90f7b-8dc4-8454-ad40-eb1a8c79b542';
|
||||
$pane = new stdClass();
|
||||
$pane->pid = 'new-a462e99c-3629-0aa4-e15f-4a84115becc7';
|
||||
$pane->panel = 'one_main';
|
||||
|
@ -96,11 +130,11 @@ function groups_directory_default_page_manager_pages() {
|
|||
);
|
||||
$pane->css = array();
|
||||
$pane->extras = array();
|
||||
$pane->position = 0;
|
||||
$pane->position = 1;
|
||||
$pane->locks = array();
|
||||
$pane->uuid = 'a462e99c-3629-0aa4-e15f-4a84115becc7';
|
||||
$display->content['new-a462e99c-3629-0aa4-e15f-4a84115becc7'] = $pane;
|
||||
$display->panels['one_main'][0] = 'new-a462e99c-3629-0aa4-e15f-4a84115becc7';
|
||||
$display->panels['one_main'][1] = 'new-a462e99c-3629-0aa4-e15f-4a84115becc7';
|
||||
$display->hide_title = PANELS_TITLE_FIXED;
|
||||
$display->title_pane = '0';
|
||||
$handler->conf['display'] = $display;
|
||||
|
|
|
@ -94,5 +94,89 @@ function groups_directory_views_default_views() {
|
|||
);
|
||||
$export['groups_groups_directory'] = $view;
|
||||
|
||||
$view = new view();
|
||||
$view->name = 'groups_map';
|
||||
$view->description = '';
|
||||
$view->tag = 'default';
|
||||
$view->base_table = 'node';
|
||||
$view->human_name = 'Groups map';
|
||||
$view->core = 7;
|
||||
$view->api_version = '3.0';
|
||||
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
|
||||
|
||||
/* Display: Master */
|
||||
$handler = $view->new_display('default', 'Master', 'default');
|
||||
$handler->display->display_options['use_more_always'] = FALSE;
|
||||
$handler->display->display_options['access']['type'] = 'perm';
|
||||
$handler->display->display_options['cache']['type'] = 'none';
|
||||
$handler->display->display_options['query']['type'] = 'views_query';
|
||||
$handler->display->display_options['exposed_form']['type'] = 'basic';
|
||||
$handler->display->display_options['pager']['type'] = 'none';
|
||||
$handler->display->display_options['pager']['options']['offset'] = '0';
|
||||
$handler->display->display_options['style_plugin'] = 'leaflet';
|
||||
$handler->display->display_options['style_options']['data_source'] = 'field_geofield';
|
||||
$handler->display->display_options['style_options']['name_field'] = 'title';
|
||||
$handler->display->display_options['style_options']['description_field'] = '#rendered_entity';
|
||||
$handler->display->display_options['style_options']['map'] = 'mapbox-warden';
|
||||
$handler->display->display_options['style_options']['icon'] = array(
|
||||
'iconUrl' => '',
|
||||
'shadowUrl' => '',
|
||||
'iconSize' => array(
|
||||
'x' => '',
|
||||
'y' => '',
|
||||
),
|
||||
'iconAnchor' => array(
|
||||
'x' => '',
|
||||
'y' => '',
|
||||
),
|
||||
'shadowAnchor' => array(
|
||||
'x' => '',
|
||||
'y' => '',
|
||||
),
|
||||
'popupAnchor' => array(
|
||||
'x' => '',
|
||||
'y' => '',
|
||||
),
|
||||
);
|
||||
/* Field: Content: Title */
|
||||
$handler->display->display_options['fields']['title']['id'] = 'title';
|
||||
$handler->display->display_options['fields']['title']['table'] = 'node';
|
||||
$handler->display->display_options['fields']['title']['field'] = 'title';
|
||||
$handler->display->display_options['fields']['title']['label'] = '';
|
||||
$handler->display->display_options['fields']['title']['alter']['word_boundary'] = FALSE;
|
||||
$handler->display->display_options['fields']['title']['alter']['ellipsis'] = FALSE;
|
||||
/* Field: Content: geofield */
|
||||
$handler->display->display_options['fields']['field_geofield']['id'] = 'field_geofield';
|
||||
$handler->display->display_options['fields']['field_geofield']['table'] = 'field_data_field_geofield';
|
||||
$handler->display->display_options['fields']['field_geofield']['field'] = 'field_geofield';
|
||||
$handler->display->display_options['fields']['field_geofield']['label'] = '';
|
||||
$handler->display->display_options['fields']['field_geofield']['element_label_colon'] = FALSE;
|
||||
$handler->display->display_options['fields']['field_geofield']['click_sort_column'] = 'geom';
|
||||
$handler->display->display_options['fields']['field_geofield']['settings'] = array(
|
||||
'data' => 'full',
|
||||
);
|
||||
/* Filter criterion: Content: Published */
|
||||
$handler->display->display_options['filters']['status']['id'] = 'status';
|
||||
$handler->display->display_options['filters']['status']['table'] = 'node';
|
||||
$handler->display->display_options['filters']['status']['field'] = 'status';
|
||||
$handler->display->display_options['filters']['status']['value'] = 1;
|
||||
$handler->display->display_options['filters']['status']['group'] = 1;
|
||||
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
|
||||
|
||||
/* Display: Content pane */
|
||||
$handler = $view->new_display('panel_pane', 'Content pane', 'panel_pane_1');
|
||||
$translatables['groups_map'] = array(
|
||||
t('Master'),
|
||||
t('more'),
|
||||
t('Apply'),
|
||||
t('Reset'),
|
||||
t('Sort by'),
|
||||
t('Asc'),
|
||||
t('Desc'),
|
||||
t('Content pane'),
|
||||
t('View panes'),
|
||||
);
|
||||
$export['groups_map'] = $view;
|
||||
|
||||
return $export;
|
||||
}
|
||||
|
|
|
@ -10,6 +10,57 @@
|
|||
function groups_groups_field_default_field_bases() {
|
||||
$field_bases = array();
|
||||
|
||||
// Exported field_base: 'field_geofield'
|
||||
$field_bases['field_geofield'] = array(
|
||||
'active' => 1,
|
||||
'cardinality' => 1,
|
||||
'deleted' => 0,
|
||||
'entity_types' => array(),
|
||||
'field_name' => 'field_geofield',
|
||||
'foreign keys' => array(),
|
||||
'indexes' => array(
|
||||
'bbox' => array(
|
||||
0 => 'top',
|
||||
1 => 'bottom',
|
||||
2 => 'left',
|
||||
3 => 'right',
|
||||
),
|
||||
'bottom' => array(
|
||||
0 => 'bottom',
|
||||
),
|
||||
'centroid' => array(
|
||||
0 => 'lat',
|
||||
1 => 'lon',
|
||||
),
|
||||
'geohash' => array(
|
||||
0 => 'geohash',
|
||||
),
|
||||
'lat' => array(
|
||||
0 => 'lat',
|
||||
),
|
||||
'left' => array(
|
||||
0 => 'left',
|
||||
),
|
||||
'lon' => array(
|
||||
0 => 'lon',
|
||||
),
|
||||
'right' => array(
|
||||
0 => 'right',
|
||||
),
|
||||
'top' => array(
|
||||
0 => 'top',
|
||||
),
|
||||
),
|
||||
'locked' => 0,
|
||||
'module' => 'geofield',
|
||||
'settings' => array(
|
||||
'backend' => 'default',
|
||||
'srid' => 4326,
|
||||
),
|
||||
'translatable' => 0,
|
||||
'type' => 'geofield',
|
||||
);
|
||||
|
||||
// Exported field_base: 'field_group_location'
|
||||
$field_bases['field_group_location'] = array(
|
||||
'active' => 1,
|
||||
|
|
|
@ -10,6 +10,42 @@
|
|||
function groups_groups_field_default_field_instances() {
|
||||
$field_instances = array();
|
||||
|
||||
// Exported field_instance: 'node-group-field_geofield'
|
||||
$field_instances['node-group-field_geofield'] = array(
|
||||
'bundle' => 'group',
|
||||
'deleted' => 0,
|
||||
'description' => '',
|
||||
'display' => array(
|
||||
'default' => array(
|
||||
'label' => 'above',
|
||||
'module' => 'geofield',
|
||||
'settings' => array(
|
||||
'data' => 'full',
|
||||
),
|
||||
'type' => 'geofield_wkt',
|
||||
'weight' => 17,
|
||||
),
|
||||
'teaser' => array(
|
||||
'label' => 'above',
|
||||
'settings' => array(),
|
||||
'type' => 'hidden',
|
||||
'weight' => 0,
|
||||
),
|
||||
),
|
||||
'entity_type' => 'node',
|
||||
'field_name' => 'field_geofield',
|
||||
'label' => 'geofield',
|
||||
'settings' => array(
|
||||
'user_register_form' => FALSE,
|
||||
),
|
||||
'widget' => array(
|
||||
'active' => 1,
|
||||
'module' => 'geofield',
|
||||
'type' => 'geofield_latlon',
|
||||
'weight' => 47,
|
||||
),
|
||||
);
|
||||
|
||||
// Exported field_instance: 'node-group-field_group_location'
|
||||
$field_instances['node-group-field_group_location'] = array(
|
||||
'bundle' => 'group',
|
||||
|
@ -93,6 +129,7 @@ function groups_groups_field_default_field_instances() {
|
|||
// Included for use with string extractors like potx.
|
||||
t('Group location');
|
||||
t('Resource links');
|
||||
t('geofield');
|
||||
|
||||
return $field_instances;
|
||||
}
|
||||
|
|
|
@ -8,8 +8,12 @@ dependencies[] = commons_groups
|
|||
dependencies[] = features
|
||||
dependencies[] = field_group_location
|
||||
dependencies[] = field_property_list
|
||||
dependencies[] = geocoder
|
||||
dependencies[] = geofield
|
||||
features[features_api][] = api:2
|
||||
features[field_base][] = field_geofield
|
||||
features[field_base][] = field_group_location
|
||||
features[field_base][] = field_resource_links
|
||||
features[field_instance][] = node-group-field_geofield
|
||||
features[field_instance][] = node-group-field_group_location
|
||||
features[field_instance][] = node-group-field_resource_links
|
||||
|
|
|
@ -14,3 +14,26 @@ function groups_groups_node_prepare($node) {
|
|||
$node->status = NODE_PUBLISHED;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook node presave
|
||||
*
|
||||
* Update geofield from group location values.
|
||||
*/
|
||||
|
||||
function groups_groups_node_presave($node) {
|
||||
if ($node->type == 'group') {
|
||||
if ((isset($node->field_group_location['und'][0]['lat']) &&
|
||||
(isset($node->field_group_location['und'][0]['lng'])))) {
|
||||
geophp_load();
|
||||
$latitude = $node->field_group_location['und'][0]['lat'];
|
||||
$longitude = $node->field_group_location['und'][0]['lng'];
|
||||
$geom = new Point($longitude, $latitude);
|
||||
$geofield = geofield_get_values_from_geometry($geom);
|
||||
$geofield['geom'] = 'POINT (' . $longitude . ' ' . $latitude . ')';
|
||||
$node->field_geofield = array('und'=>array($geofield));
|
||||
} else {
|
||||
$node->field_geofield = array();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue