本文整理汇总了PHP中iform_map_get_ol_options函数的典型用法代码示例。如果您正苦于以下问题:PHP iform_map_get_ol_options函数的具体用法?PHP iform_map_get_ol_options怎么用?PHP iform_map_get_ol_options使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了iform_map_get_ol_options函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_form
/**
* Return the Indicia form code
* @param array $args Input parameters.
* @param array $node Drupal node object
* @param array $response Response from Indicia services after posting.
* @return HTML string
*/
public static function get_form($args, $node, $response)
{
iform_load_helpers(array('report_helper', 'map_helper'));
$auth = report_helper::get_read_auth($args['website_id'], $args['password']);
$reportOptions = iform_report_get_report_options($args, $auth);
$r = '<div class="ui-helper-clearfix">';
$reportOptions['geoserverLayer'] = $args['geoserver_layer'];
$reportOptions['geoserverLayerStyle'] = $args['geoserver_layer_style'];
$reportOptions['cqlTemplate'] = $args['cql_template'];
$reportOptions['clickable'] = $args['click_on_map_mode'] != 'none';
$reportOptions['clickableLayersOutputDiv'] = $args['click_on_map_div'];
if (!empty($args['click_on_map_columns'])) {
$reportOptions['clickableLayersOutputColumns'] = helper_base::explode_lines_key_value_pairs($args['click_on_map_columns']);
}
if ($args['click_on_map_mode'] != 'none') {
$reportOptions['clickableLayersOutputMode'] = $args['click_on_map_mode'];
}
// Use the proxy module if enabled, to get round limitations in URL length for
// filtered WMS requests.
if (defined('DRUPAL_BOOTSTRAP_CONFIGURATION') && module_exists('iform_proxy')) {
global $base_url;
$reportOptions['proxy'] = $base_url . '/?q=' . variable_get('iform_proxy_path', 'proxy') . '&url=';
}
$r .= '<br/>' . report_helper::report_map($reportOptions);
$options = iform_map_get_map_options($args, $readAuth);
$olOptions = iform_map_get_ol_options($args);
// This is used for drawing, so need an editlayer, but not used for input
$options['editLayer'] = true;
$options['editLayerInSwitcher'] = true;
$options['clickForSpatialRef'] = false;
if ($args['layer_picker'] != 'none') {
$picker = array('id' => 'map-layer-picker', 'includeIcons' => false, 'includeSwitchers' => true, 'includeHiddenLayers' => true);
if ($args['layer_picker'] == 'before') {
$r .= map_helper::layer_list($picker);
}
// as we have a layer picker, we can drop the layerSwitcher from the OL map.
if (array_search('layerSwitcher', $options['standardControls']) !== false) {
unset($options['standardControls'][array_search('layerSwitcher', $options['standardControls'])]);
}
}
if ($args['legend'] != 'none') {
$legend = array('id' => 'map-legend', 'includeIcons' => true, 'includeSwitchers' => false, 'includeHiddenLayers' => false);
if ($args['legend'] == 'before') {
$r .= map_helper::layer_list($legend);
}
}
if (isset($args['map_toolbar_pos'])) {
$options['toolbarDiv'] = $args['map_toolbar_pos'];
}
$r .= map_helper::map_panel($options, $olOptions);
if ($args['layer_picker'] == 'after') {
$r .= map_helper::layer_list($picker);
}
if ($args['legend'] == 'after') {
$r .= map_helper::layer_list($legend);
}
$r .= '</div>';
return $r;
}
开发者ID:BirenRathod,项目名称:drupal-6,代码行数:66,代码来源:report_map.php
示例2: get_form
/**
* Return the generated form output.
* @return Form HTML.
* @todo: Implement this method
*/
public static function get_form($args)
{
global $user;
$lang = isset($user) ? iform_lang_iso_639_2($user->lang) : 'eng';
if (function_exists('iform_load_helpers')) {
iform_load_helpers(array('map_helper'));
} else {
require_once dirname(dirname(__FILE__)) . '/map_helper.php';
}
$readAuth = data_entry_helper::get_read_auth($args['website_id'], $args['password']);
$r = '';
// setup the map options
$options = iform_map_get_map_options($args, $readAuth);
$olOptions = iform_map_get_ol_options($args);
if (array_key_exists('table', $_GET) && $_GET['table'] == 'sample') {
// Use a cUrl request to get the data from Indicia which contains the value we need to filter against
// Read the record that was just posted.
$fetchOpts = array('dataSource' => 'reports_for_prebuilt_forms/my_dot_map/occurrences_list', 'mode' => 'report', 'readAuth' => $readAuth, 'extraParams' => array('sample_id' => $_GET['id'], 'language' => $lang));
// @todo Error handling on the response
$occurrence = data_entry_helper::get_report_data($fetchOpts);
self::prepare_layer_titles($args, $occurrence);
// Add the 3 distribution layers if present. Reverse the order so 1st layer is topmost
$layerName = self::build_distribution_layer(3, $args, $occurrence);
if ($layerName) {
$options['layers'][] = $layerName;
}
$layerName = self::build_distribution_layer(2, $args, $occurrence);
if ($layerName) {
$options['layers'][] = $layerName;
}
$layerName = self::build_distribution_layer(1, $args, $occurrence);
if ($layerName) {
$options['layers'][] = $layerName;
}
if ($layerName) {
$options['layers'][] = $layerName;
}
// This is not a map used for input
$options['editLayer'] = false;
if ($args['hide_grid'] == false) {
// Now output a grid of the occurrences that were just saved.
$r .= "<table class=\"submission\"><thead><tr><th>" . lang::get('Species') . "</th><th>" . lang::get('Latin Name') . "</th><th>" . lang::get('Date') . "</th><th>" . lang::get('Spatial Ref') . "</th></tr></thead>\n";
$r .= "<tbody>\n";
foreach ($occurrence as $record) {
$r .= '<tr class="biota"><td>' . $record['lt4_taxon'] . '</td><td class="binomial"><em>' . $record['lt7_taxon'] . '</em></td><td>' . $record['lt0_date_start'] . '</td><td>' . $record['lt0_entered_sref'] . "</td></tr>\n";
}
$r .= "</tbody></table>\n";
}
}
$r .= '<div id="mapandlegend">';
$r .= map_helper::layer_list(array('id' => 'legend', 'includeSwitchers' => false, 'includeHiddenLayers' => false, 'includeIcons' => true, 'layerTypes' => array('overlay')));
$r .= map_helper::map_panel($options, $olOptions);
$r .= '</div>';
return $r;
}
开发者ID:BirenRathod,项目名称:drupal-6,代码行数:60,代码来源:my_dot_map.php
示例3: get_form
/**
* Return the generated form output.
* @return Form HTML.
*/
public static function get_form($args)
{
iform_load_helpers(array('map_helper'));
$readAuth = map_helper::get_read_auth($args['website_id'], $args['password']);
// setup the map options
$options = iform_map_get_map_options($args, $readAuth);
$olOptions = iform_map_get_ol_options($args);
for ($layer = 1; $layer <= 3; $layer++) {
$argTitle = $args["layer_title_{$layer}"];
if (isset($argTitle) && !empty($argTitle)) {
//if there is no title then ignore the layer
$meaningId = self::get_meaning_id($layer, $args, $readAuth);
$taxon = self::get_taxon($meaningId, $readAuth);
$layerTitle = str_replace('{species}', $taxon, $argTitle);
$layerTitle = str_replace("'", "\\'", $layerTitle);
$url = map_helper::$geoserver_url . 'wms';
$argFeature = $args["wms_feature_type_{$layer}"];
$layers = "layers: '{$argFeature}'";
$argStyle = $args["wms_style_{$layer}"];
$style = $argStyle ? ", styles: '{$argStyle}'" : '';
$argWebsite = $args["website_id"];
$filter = ", CQL_FILTER: 'website_id={$argWebsite} AND taxon_meaning_id={$meaningId}";
$argCql = $args["cql_filter_{$layer}"];
if ($argCql) {
$arg = str_replace("'", "\\'", $argCql);
$filter .= " AND({$argCql})'";
} else {
$filter .= "'";
}
$script = " var distLayer{$layer} = new OpenLayers.Layer.WMS(";
$script .= "'{$layerTitle}', '{$url}',";
$script .= "{" . "{$layers}, transparent: true {$filter} {$style}},";
$script .= "{isBaseLayer: false, sphericalMercator: true, singleTile: true}";
$script .= ");\n";
map_helper::$onload_javascript .= $script;
$options['layers'][] = "distLayer{$layer}";
}
}
// This is not a map used for input
$options['editLayer'] = false;
// output a legend
$r .= map_helper::layer_list(array('includeSwitchers' => true, 'includeHiddenLayers' => true));
// output a map
$r .= map_helper::map_panel($options, $olOptions);
// Set up a page refresh for dynamic update of the map at set intervals
if ($args['refresh_timer'] !== 0 && is_numeric($args['refresh_timer'])) {
// is_int prevents injection
if (isset($args['load_on_refresh']) && !empty($args['load_on_refresh'])) {
map_helper::$javascript .= "setTimeout('window.location=\"" . $args['load_on_refresh'] . "\";', " . $args['refresh_timer'] . "*1000 );\n";
} else {
map_helper::$javascript .= "setTimeout('window.location.reload( false );', " . $args['refresh_timer'] . "*1000 );\n";
}
}
return $r;
}
开发者ID:BirenRathod,项目名称:indicia-code,代码行数:59,代码来源:distribution_map_3.php
示例4: get_form
/**
* Return the generated form output.
* @return Form HTML.
* @todo: Implement this method
*/
public static function get_form($args)
{
global $user;
$readAuth = data_entry_helper::get_read_auth($args['website_id'], $args['password']);
// setup the map options
$options = iform_map_get_map_options($args, $readAuth);
$olOptions = iform_map_get_ol_options($args);
if (array_key_exists('table', $_GET) && $_GET['table'] == 'sample') {
// Use a cUrl request to get the data from Indicia which contains the value we need to filter against
// Read the record that was just posted.
$fetchOpts = array('dataSource' => 'reports_for_prebuilt_forms/my_dot_map/occurrences_list', 'mode' => 'report', 'readAuth' => $readAuth, 'extraParams' => array('sample_id' => $_GET['id'], 'language' => iform_lang_iso_639_2($user->lang)));
// @todo Error handling on the response
$occurrence = data_entry_helper::get_report_data($fetchOpts);
$legend = '';
self::prepare_layer_titles($args, $occurrence);
// Add the 3 distribution layers if present. Reverse the order so 1st layer is topmost
$layerName = self::build_distribution_layer(3, $args, $occurrence);
if ($layerName) {
$options['layers'][] = $layerName;
$legend = '<div><img src="' . data_entry_helper::$geoserver_url . 'wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&LAYER=detail_occurrences&Format=image/jpeg' . '&STYLE=' . $args["wms_dist_3_style"] . '" alt=""/>' . $args["wms_dist_3_title"] . '</div>' . $legend;
}
$layerName = self::build_distribution_layer(2, $args, $occurrence);
if ($layerName) {
$options['layers'][] = $layerName;
$legend = '<div><img src="' . data_entry_helper::$geoserver_url . 'wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&LAYER=detail_occurrences&Format=image/jpeg' . '&STYLE=' . $args["wms_dist_2_style"] . '" alt=""/>' . $args["wms_dist_2_title"] . '</div>' . $legend;
}
$layerName = self::build_distribution_layer(1, $args, $occurrence);
if ($layerName) {
$options['layers'][] = $layerName;
$legend = '<div><img src="' . data_entry_helper::$geoserver_url . 'wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&LAYER=detail_occurrences&Format=image/png' . '&STYLE=' . $args["wms_dist_1_style"] . '" alt=""/>' . $args["wms_dist_1_title"] . '</div>' . $legend;
}
if ($layerName) {
$options['layers'][] = $layerName;
}
// This is not a map used for input
$options['editLayer'] = false;
// Now output a grid of the occurrences that were just saved.
$r .= "<table class=\"submission\"><thead><tr><th>" . lang::get('Species') . "</th><th>" . lang::get('Latin Name') . "</th><th>" . lang::get('Date') . "</th><th>" . lang::get('Spatial Ref') . "</th></tr></thead>\n";
$r .= "<tbody>\n";
foreach ($occurrence as $record) {
$r .= '<tr class="biota"><td>' . $record['lt4_taxon'] . '</td><td class="binomial"><em>' . $record['lt7_taxon'] . '</em></td><td>' . $record['lt0_date_start'] . '</td><td>' . $record['lt0_entered_sref'] . "</td></tr>\n";
}
$r .= "</tbody></table>\n";
$r .= '<div id="legend" class="ui-widget ui-widget-content ui-corner-all">' . $legend . '</div>';
}
$r .= data_entry_helper::map_panel($options, $olOptions);
return $r;
}
开发者ID:BirenRathod,项目名称:drupal-6,代码行数:53,代码来源:my_dot_map.php
示例5: count_by_location_map
/**
* Outputs a map with an overlay of regions, showing a count for each. Default is to count records, but can
* be configured to count taxa.
*
* @param array $auth Authorisation tokens.
* @param array $args Form arguments (the settings on the form edit tab).
* @param string $tabalias The alias of the tab this is being loaded onto.
* @param array $options The options passed to this control using @option=value settings in the form structure.
* Options supported are those which can be passed to the report_helper::report_map method. In addition
* set @output=species to configure the report to show a species counts map.
* @param string $path The page reload path, in case it is required for the building of links.
* @return string HTML to insert into the page for the location map. JavaScript is added to the variables in helper_base.
*
* @link http://www.biodiverseit.co.uk/indicia/dev/docs/classes/report_helper.html#method_report_map API docs for report_helper::report_map
*/
public static function count_by_location_map($auth, $args, $tabalias, $options, $path)
{
iform_load_helpers(array('map_helper', 'report_helper'));
require_once iform_client_helpers_path() . 'prebuilt_forms/includes/map.php';
$mapOptions = iform_map_get_map_options($args, $auth['read']);
$olOptions = iform_map_get_ol_options($args);
$mapOptions['clickForSpatialRef'] = false;
$r = map_helper::map_panel($mapOptions, $olOptions);
if (!empty($options['output']) && $options['output'] === 'species') {
$type = 'species';
} else {
$type = 'occurrence';
}
$reportOptions = array_merge(iform_report_get_report_options($args, $auth['read']), array('dataSource' => "library/locations/{$type}_counts_mappable_for_event", 'featureDoubleOutlineColour' => '#f7f7f7', 'rowId' => 'id'), $options);
$r .= report_helper::report_map($reportOptions);
return $r;
}
开发者ID:BirenRathod,项目名称:drupal-6,代码行数:32,代码来源:event_reports.php
示例6: count_by_location_map
/**
* Outputs a map with an overlay of regions, showing a count for each. Default is to count records, but can
* be configured to count taxa.
*
* @param array $auth Authorisation tokens.
* @param array $args Form arguments (the settings on the form edit tab).
* @param string $tabalias The alias of the tab this is being loaded onto.
* @param array $options The options passed to this control using @option=value settings in the form structure.
* Options supported are those which can be passed to the report_helper::report_map method. In addition
* set @output=species to configure the report to show a species counts map and set @title=... to
* include a heading in the output.
* @param string $path The page reload path, in case it is required for the building of links.
* @return string HTML to insert into the page for the location map. JavaScript is added to the variables in helper_base.
*
* @link http://www.biodiverseit.co.uk/indicia/dev/docs/classes/report_helper.html#method_report_map API docs for report_helper::report_map
*/
public static function count_by_location_map($auth, $args, $tabalias, $options, $path)
{
iform_load_helpers(array('map_helper', 'report_helper'));
require_once iform_client_helpers_path() . 'prebuilt_forms/includes/map.php';
$mapOptions = iform_map_get_map_options($args, $auth['read']);
$olOptions = iform_map_get_ol_options($args);
$mapOptions['clickForSpatialRef'] = false;
if ($args['interface'] !== 'one_page') {
$mapOptions['tabDiv'] = $tabalias;
}
$r = self::output_title($options);
$r .= map_helper::map_panel($mapOptions, $olOptions);
if (!empty($options['output']) && $options['output'] === 'species') {
$type = 'species';
} else {
$type = 'occurrence';
}
$subtype = empty($options['linked']) || $options['linked'] === false ? '' : '_linked';
$reportOptions = array_merge(iform_report_get_report_options($args, $auth['read']), array('dataSource' => "library/locations/filterable_{$type}_counts_mappable{$subtype}", 'featureDoubleOutlineColour' => '#f7f7f7', 'rowId' => 'id', 'caching' => true, 'cachePerUser' => false), $options);
$r .= report_helper::report_map($reportOptions);
return $r;
}
开发者ID:BirenRathod,项目名称:indicia-code,代码行数:38,代码来源:event_reports.php
示例7: get_form
/**
* Return the generated form output.
* @return Form HTML.
* @todo: Implement this method
*/
public static function get_form($args)
{
$readAuth = data_entry_helper::get_read_auth($args['website_id'], $args['password']);
// setup the map options
$options = iform_map_get_map_options($args, $readAuth);
$olOptions = iform_map_get_ol_options($args);
if (array_key_exists('table', $_GET) && $_GET['table'] == 'sample') {
// Use a cUrl request to get the data from Indicia which contains the value we need to filter against
// Read the record that was just posted.
$fetchOpts = array('table' => 'occurrence', 'extraParams' => $readAuth + array('sample_id' => $_GET['id'], 'view' => 'detail'));
// @todo Error handling on the response
$occurrence = data_entry_helper::get_population_data($fetchOpts);
}
// Add the 3 distribution layers if present. Reverse the order so 1st layer is topmost
$layerName = self::build_distribution_layer(3, $args, $occurrence);
if ($layerName) {
$options['layers'][] = $layerName;
}
$layerName = self::build_distribution_layer(2, $args, $occurrence);
if ($layerName) {
$options['layers'][] = $layerName;
}
$layerName = self::build_distribution_layer(1, $args, $occurrence);
if ($layerName) {
$options['layers'][] = $layerName;
}
// Now output a grid of the occurrences that were just saved.
if (isset($occurrence)) {
$r .= "<table class=\"submission\"><thead><tr><th>Species</th><th>Date</th><th>Spatial Reference</th></tr></thead>\n";
$r .= "<tbody>\n";
foreach ($occurrence as $record) {
$r .= "<tr><td>" . $record['taxon'] . "</td><td>" . $record['date_start'] . "</td><td>" . $record['entered_sref'] . "</td></tr>\n";
}
$r .= "</tbody></table>\n";
}
$r .= data_entry_helper::map_panel($options, $olOptions);
return $r;
}
开发者ID:BirenRathod,项目名称:drupal-6,代码行数:43,代码来源:my_dot_map.php
示例8: get_control_map
/**
* Get the map control.
*/
protected static function get_control_map($auth, $args, $tabalias, $options)
{
$options = array_merge(iform_map_get_map_options($args, $auth['read']), $options);
if (isset(data_entry_helper::$entity_to_load['sample:geom'])) {
$options['initialFeatureWkt'] = data_entry_helper::$entity_to_load['sample:wkt'];
}
if ($args['interface'] !== 'one_page') {
$options['tabDiv'] = $tabalias;
}
$olOptions = iform_map_get_ol_options($args);
if (!isset($options['standardControls'])) {
$options['standardControls'] = array('layerSwitcher', 'panZoom');
}
return data_entry_helper::map_panel($options, $olOptions);
}
开发者ID:BirenRathod,项目名称:indicia-code,代码行数:18,代码来源:wwt_colour_marked_report.php
示例9: get_template_with_map
private static function get_template_with_map($args, $readAuth, $extraParams, $paramDefaults)
{
$r = '<div id="outer-with-map" class="ui-helper-clearfix">';
$r .= '<div id="grid" class="left" style="width:65%">{paramsForm}{grid}';
// Insert a button to verify all visible, only available if viewing the clean records.
if (isset($_POST['verification-rule']) && $_POST['verification-rule'] === 'none' && empty($_POST['verification-id'])) {
$r .= '<button type="button" id="btn-verify-all">' . lang::get('Verify all visible') . '</button>';
}
$r .= '</div>';
$r .= '<div id="map-and-record" class="right" style="width: 34%"><div id="summary-map">';
$options = iform_map_get_map_options($args, $readAuth);
$olOptions = iform_map_get_ol_options($args);
// This is used for drawing, so need an editlayer, but not used for input
$options['editLayer'] = true;
$options['editLayerInSwitcher'] = true;
$options['clickForSpatialRef'] = false;
$options['featureIdField'] = 'occurrence_id';
$r .= map_helper::map_panel($options, $olOptions);
$reportMapOpts = array('dataSource' => !empty($args['mapping_report_name']) ? $args['mapping_report_name'] : $args['report_name'], 'mode' => 'report', 'readAuth' => $readAuth, 'autoParamsForm' => false, 'extraParams' => $extraParams, 'paramDefaults' => $paramDefaults, 'reportGroup' => 'verification', 'clickableLayersOutputMode' => 'report', 'rowId' => 'occurrence_id', 'sharing' => 'verification', 'ajax' => TRUE);
if (!empty($args['mapping_report_name_lores'])) {
$reportMapOpts['dataSourceLoRes'] = $args['mapping_report_name_lores'];
}
$r .= report_helper::report_map($reportMapOpts);
$r .= '</div>';
global $user;
if (function_exists('hostsite_get_user_field') && ($locationId = hostsite_get_user_field('location_expertise', false))) {
iform_map_zoom_to_location($locationId, $readAuth);
}
$r .= '<div id="record-details-wrap" class="ui-widget ui-widget-content">';
$r .= self::instructions('grid on the left');
$r .= '<div id="record-details-content" style="display: none">';
$r .= '<div id="record-details-toolbar">';
$r .= '<label>Set status:</label>';
$r .= '<button type="button" id="btn-verify">' . lang::get('Verify') . '</button>';
$r .= '<button type="button" id="btn-reject">' . lang::get('Reject') . '</button>';
$r .= '<button type="button" id="btn-query">' . lang::get('Query') . '</button>';
$r .= '<button type="button" id="btn-multiple" title="' . lang::get('Select this tool to tick off a list of records and action all of the ticked records in one go') . '">' . lang::get('Select records') . '</button>';
$r .= '<br/><label>Contact:</label>';
$r .= '<button type="button" id="btn-email-expert" class="default-button">' . lang::get('Another expert') . '</button>';
$r .= '<button type="button" id="btn-email-recorder" class="default-button">' . lang::get('Recorder') . '</button>';
$r .= '</div>';
$r .= '<div id="record-details-tabs">';
// note - there is a dependency in the JS that comments is the last tab and images the 2nd to last.
$r .= data_entry_helper::tab_header(array('tabs' => array('#details-tab' => lang::get('Details'), '#experience-tab' => lang::get('Experience'), '#phenology-tab' => lang::get('Phenology'), '#images-tab' => lang::get('Images'), '#comments-tab' => lang::get('Comments'))));
data_entry_helper::$javascript .= "indiciaData.detailsTabs = ['details','experience','phenology','images','comments'];\n";
data_entry_helper::enable_tabs(array('divId' => 'record-details-tabs'));
$r .= '<div id="details-tab"></div>';
$r .= self::other_tab_html();
$r .= '</div></div></div></div></div>';
return $r;
}
开发者ID:BirenRathod,项目名称:drupal-6,代码行数:51,代码来源:verification_4.php
示例10: get_control_map
protected static function get_control_map($auth, $args, $tabalias, $options)
{
iform_load_helpers(array('map_helper', 'report_helper'));
// $_GET data for standard params can override displayed location
if (isset($_GET['filter-location_id']) || isset($_GET['filter-indexed_location_id'])) {
$args['display_user_profile_location'] = false;
if (!empty($_GET['filter-indexed_location_id'])) {
$args['location_boundary_id'] = $_GET['filter-indexed_location_id'];
} elseif (!empty($_GET['filter-location_id'])) {
$args['location_boundary_id'] = $_GET['filter-location_id'];
}
}
// allow us to call iform_report_get_report_options to get a default report setup, then override report_name
$args['report_name'] = '';
$sharing = empty($args['sharing']) ? 'reporting' : $args['sharing'];
$reportOptions = array_merge(iform_report_get_report_options($args, $auth['read']), array('reportGroup' => 'dynamic', 'autoParamsForm' => false, 'sharing' => $sharing, 'readAuth' => $auth['read'], 'dataSource' => $options['dataSource'], 'reportGroup' => 'dynamic', 'rememberParamsReportGroup' => 'dynamic', 'clickableLayersOutputMode' => 'report', 'rowId' => 'occurrence_id', 'ajax' => TRUE), $options);
if (self::$applyUserPrefs) {
iform_report_apply_explore_user_own_preferences($reportOptions);
}
$r = report_helper::report_map($reportOptions);
$options = array_merge(iform_map_get_map_options($args, $auth['read']), array('featureIdField' => 'occurrence_id', 'clickForSpatialRef' => false, 'reportGroup' => 'explore', 'toolbarDiv' => 'top'), $options);
$olOptions = iform_map_get_ol_options($args);
$r .= map_helper::map_panel($options, $olOptions);
return $r;
}
开发者ID:BirenRathod,项目名称:drupal-6,代码行数:25,代码来源:dynamic_report_explorer.php
示例11: get_site_tab
//.........这里部分代码省略.........
$r .= '<input type="hidden" name="location:id" id="location:id" value="' . $settings['locationId'] . "\" />\n";
}
$r .= data_entry_helper::text_input(array('fieldname' => 'location:name', 'label' => lang::get('Site Name'), 'class' => 'control-width-4 required', 'disabled' => $settings['canEditBody'] ? '' : ' disabled="disabled" '));
if (!$settings['canEditBody']) {
$r .= '<p>' . lang::get('This site cannot be edited because there are walks recorded on it. Please contact the site administrator if you think there are details which need changing.') . '</p>';
} else {
if (count($settings['walks']) > 0) {
// can edit it
$r .= '<p>' . lang::get('This site has walks recorded on it. Please do not change the site details without considering the impact on the existing data.') . '</p>';
}
}
$list = explode(',', str_replace(' ', '', $args['spatial_systems']));
foreach ($list as $system) {
$systems[$system] = lang::get($system);
}
if (isset(data_entry_helper::$entity_to_load['location:centroid_sref_system']) && in_array(data_entry_helper::$entity_to_load['location:centroid_sref_system'], array('osgb', 'osie'))) {
data_entry_helper::$entity_to_load['location:centroid_sref_system'] = strtoupper(data_entry_helper::$entity_to_load['location:centroid_sref_system']);
}
$r .= data_entry_helper::sref_and_system(array('fieldname' => 'location:centroid_sref', 'geomFieldname' => 'location:centroid_geom', 'label' => 'Grid Ref.', 'systems' => $systems, 'class' => 'required', 'helpText' => lang::get('Click on the map to set the central grid reference.'), 'disabled' => $settings['canEditBody'] ? '' : ' disabled="disabled" '));
if ($settings['locationId'] && data_entry_helper::$entity_to_load['location:code'] != '' && data_entry_helper::$entity_to_load['location:code'] != null) {
$r .= data_entry_helper::text_input(array('fieldname' => 'location:code', 'label' => lang::get('Site Code'), 'class' => 'control-width-4', 'disabled' => ' readonly="readonly" '));
} else {
$r .= "<p>" . lang::get('The Site Code will be allocated by the Administrator.') . "</p>";
}
// setup the map options
$options = iform_map_get_map_options($args, $auth['read']);
// find the form blocks that need to go below the map.
$bottom = '';
$bottomBlocks = explode("\n", isset($args['bottom_blocks']) ? $args['bottom_blocks'] : '');
foreach ($bottomBlocks as $block) {
$bottom .= get_attribute_html($settings['attributes'], $args, array('extraParams' => $auth['read'], 'disabled' => $settings['canEditBody'] ? '' : ' disabled="disabled" '), $block);
}
// other blocks to go at the top, next to the map
if (isset($args['site_help']) && $args['site_help'] != '') {
$r .= '<p class="ui-state-highlight page-notice ui-corner-all">' . t($args['site_help']) . '</p>';
}
$r .= get_attribute_html($settings['attributes'], $args, array('extraParams' => $auth['read']));
$r .= '</fieldset>';
$r .= "</div>";
// left
$r .= '<div class="right" style="width: 44%">';
if (!$settings['locationId']) {
$help = t('Use the search box to find a nearby town or village, then drag the map to pan and click on the map to set the centre grid reference of the transect. ' . 'Alternatively if you know the grid reference you can enter it in the Grid Ref box on the left.');
$r .= '<p class="ui-state-highlight page-notice ui-corner-all">' . $help . '</p>';
$r .= data_entry_helper::georeference_lookup(array('label' => lang::get('Search for place'), 'driver' => $args['georefDriver'], 'georefPreferredArea' => $args['georefPreferredArea'], 'georefCountry' => $args['georefCountry'], 'georefLang' => $args['language'], 'readAuth' => $auth['read']));
}
if (isset($args['maxPrecision']) && $args['maxPrecision'] != '') {
$options['clickedSrefPrecisionMax'] = $args['maxPrecision'];
}
if (isset($args['minPrecision']) && $args['minPrecision'] != '') {
$options['clickedSrefPrecisionMin'] = $args['minPrecision'];
}
$olOptions = iform_map_get_ol_options($args);
$options['clickForSpatialRef'] = $settings['canEditBody'];
$r .= map_helper::map_panel($options, $olOptions);
$r .= '</div></div>';
// right
if (!empty($bottom)) {
$r .= $bottom;
}
if ($args['branch_assignment_permission'] != '') {
if ($settings['canAllocBranch'] || $settings['locationId']) {
$r .= self::get_branch_assignment_control($auth['read'], $settings['branchCmsUserAttr'], $args, $settings);
}
}
if ($args['allow_user_assignment']) {
if ($settings['canAllocUser']) {
$r .= self::get_user_assignment_control($auth['read'], $settings['cmsUserAttr'], $args);
} else {
if (!$settings['locationId']) {
// for a new record, we need to link the current user to the location if they are not admin.
global $user;
$r .= '<input type="hidden" name="locAttr:' . self::$cmsUserAttrId . '" value="' . $user->uid . '">';
}
}
}
if ($settings['canEditBody']) {
$r .= '<button type="submit" class="indicia-button right">' . lang::get('Save') . '</button>';
}
if ($settings['canEditBody'] && $settings['locationId']) {
$r .= '<button type="button" class="indicia-button right" id="delete-transect">' . lang::get('Delete') . '</button>';
}
$r .= '</form>';
$r .= '</div>';
// site-details
// This must go after the map panel, so it has created its toolbar
data_entry_helper::$onload_javascript .= "\$('#current-section').change(selectSection);\n";
if ($settings['canEditBody'] && $settings['locationId']) {
$walkIDs = array();
foreach ($settings['walks'] as $walk) {
$walkIDs[] = $walk['id'];
}
$sectionIDs = array();
foreach ($settings['sections'] as $code => $section) {
$sectionIDs[] = $section['id'];
}
data_entry_helper::$javascript .= "\r\ndeleteSurvey = function(){\r\n if(confirm(\"" . (count($settings['walks']) > 0 ? count($settings['walks']) . ' ' . lang::get('walks will also be deleted when you delete this location.') . ' ' : '') . lang::get('Are you sure you wish to delete this location?') . "\")){\r\n deleteWalks([" . implode(',', $walkIDs) . "]);\r\n deleteSections([" . implode(',', $sectionIDs) . "]);\r\n \$('#delete-transect').html('Deleting Site');\r\n deleteLocation(" . $settings['locationId'] . ");\r\n \$('#delete-transect').html('Done');\r\n window.location='" . url($args['sites_list_path']) . "';\r\n };\r\n};\r\n\$('#delete-transect').click(deleteSurvey);\r\n";
}
return $r;
}
开发者ID:joewoodhouse,项目名称:client_helpers,代码行数:101,代码来源:ukbms_sectioned_transects_edit_transect.php
示例12: get_control_map
/**
* Get the map control.
*/
private static function get_control_map($auth, $args, $tabalias, $options)
{
$options = array_merge(iform_map_get_map_options($args, $auth['read']), $options);
if ($args['interface'] !== 'one_page') {
$options['tabDiv'] = $tabalias;
}
if (self::$want_location_layer) {
$options['layers'][] = 'locationLayer';
// Create vector layers to display a selected location onto
$options['setupJs'] = "\n locStyleMap = new OpenLayers.StyleMap({\n \"default\": new OpenLayers.Style({\n fillColor: \"Green\",\n strokeColor: \"Black\",\n fillOpacity: 0.3,\n strokeWidth: 1\n })\n });\n locationLayer = new OpenLayers.Layer.Vector(\"" . lang::get("LANG_Location_Layer") . "\",\n {styleMap: locStyleMap});\n";
}
$olOptions = iform_map_get_ol_options($args);
return data_entry_helper::map_panel($options, $olOptions);
}
开发者ID:BirenRathod,项目名称:drupal-6,代码行数:17,代码来源:mnhnl_dynamic_1.php
示例13: get_sample_form
public static function get_sample_form($args, $node, $response)
{
global $user;
iform_load_helpers(array('map_helper'));
$auth = data_entry_helper::get_read_write_auth($args['website_id'], $args['password']);
// either looking at existing, creating a new one, or an error occurred: no successful posts...
// first check some conditions are met
$sampleMethods = helper_base::get_termlist_terms($auth, 'indicia:sample_methods', array('Timed Count'));
if (count($sampleMethods) == 0) {
return 'The sample method "Timed Count" must be defined in the termlist in order to use this form.';
}
$sampleId = isset($_GET['sample_id']) ? $_GET['sample_id'] : null;
if ($sampleId && !isset(data_entry_helper::$validation_errors)) {
data_entry_helper::load_existing_record($auth['read'], 'sample', $sampleId);
}
$isAdmin = isset($args['manager_permission']) && user_access($args['manager_permission']);
// The following is butchered from mnhnl.
data_entry_helper::$javascript .= "\r\n// the default edit layer is used for this sample\r\nvar editLayer = null;\r\n\r\nconvertGeom = function(geom, projection){\r\n if (projection.projcode!='EPSG:900913' && projection.projcode!='EPSG:3857') {\r\n var cloned = geom.clone();\r\n return cloned.transform(new OpenLayers.Projection('EPSG:900913'), projection);\r\n }\r\n return geom;\r\n}\r\nreverseConvertGeom = function(geom, projection){\r\n if (projection.projcode!='EPSG:900913' && projection.projcode!='EPSG:3857') {\r\n var cloned = geom.clone();\r\n return cloned.transform(projection, new OpenLayers.Projection('EPSG:900913'));\r\n }\r\n return geom;\r\n}\r\n\r\ngetwkt = function(geometry, incFront, incBrackets){\r\n var retVal;\r\n \t retVal = '';\r\n \t switch(geometry.CLASS_NAME){\r\n \t case \"OpenLayers.Geometry.Point\":\r\n \t return((incFront!=false ? 'POINT' : '')+(incBrackets!=false ? '(' : '')+geometry.x+' '+geometry.y+(incBrackets!=false ? ')' : ''));\r\n \t break;\r\n \t case \"OpenLayers.Geometry.MultiPoint\":\r\n retVal = 'MULTIPOINT(';\r\n for(var i=0; i< geometry.components.length; i++)\r\n retVal += (i!=0 ? ',':'')+getwkt(geometry.components[i], false, true);\r\n retVal += ')';\r\n break;\r\n case \"OpenLayers.Geometry.LineString\":\r\n retVal = (incFront!=false ? 'LINESTRING' : '')+'(';\r\n for(var i=0; i< geometry.components.length; i++)\r\n retVal += (i!=0 ? ',':'')+getwkt(geometry.components[i], false, false);\r\n retVal += ')';\r\n break;\r\n case \"OpenLayers.Geometry.MultiLineString\":\r\n retVal = 'MULTILINESTRING(';\r\n for(var i=0; i< geometry.components.length; i++)\r\n retVal += (i!=0 ? ',':'')+getwkt(geometry.components[i], false, true);\r\n retVal += ')';\r\n break;\r\n case \"OpenLayers.Geometry.Polygon\": // only do outer ring\r\n retVal = (incFront!=false ? 'POLYGON' : '')+'((';\r\n for(var i=0; i< geometry.components[0].components.length; i++)\r\n retVal += (i!=0 ? ',':'')+getwkt(geometry.components[0].components[i], false, false);\r\n retVal += '))';\r\n break;\r\n case \"OpenLayers.Geometry.MultiPolygon\":\r\n retVal = 'MULTIPOLYGON(';\r\n for(var i=0; i< geometry.components.length; i++)\r\n retVal += (i!=0 ? ',':'')+getwkt(geometry.components[i], false, true);\r\n retVal += ')';\r\n break;\r\n case \"OpenLayers.Geometry.Collection\":\r\n retVal = 'GEOMETRYCOLLECTION(';\r\n for(var i=0; i< geometry.components.length; i++)\r\n retVal += (i!=0 ? ',':'')+getwkt(geometry.components[i], true, true);\r\n retVal += ')';\r\n break;\r\n }\r\n return retVal;\r\n}\r\nsetSref = function(geometry){\r\n var centre = getCentroid(geometry);\r\n centre = reverseConvertGeom(centre, editLayer.map.projection); // convert to indicia internal projection\r\n var system = \$('#imp-sref-system').val();\t\t\t\t\r\n jQuery.getJSON('" . data_entry_helper::$base_url . "/index.php/services/spatial/wkt_to_sref?wkt=POINT(' + centre.x + ' ' + centre.y + ')&system=' + system + '&precision=" . (isset($args['precision']) && $args['precision'] != '' ? $args['precision'] : '8') . "&callback=?',\r\n function(data){\r\n if(typeof data.error != 'undefined')\r\n alert(data.error);\r\n else\r\n \$('#imp-sref').val(data.sref);\r\n });\r\n};\r\nhook_setGeomFields = [];\r\nsetGeomFields = function(){\r\n var geomstack = [];\r\n var completeGeom;\r\n for(var i=0; i<editLayer.features.length; i++)\r\n if(editLayer.features[i].attributes.highlighted == true)\r\n geomstack.push(editLayer.features[i].geometry.clone()); // needs to be a clone as we don't want to transform the original geoms.\r\n if(geomstack.length == 0){\r\n jQuery('#imp-geom').val('');\r\n jQuery('#imp-sref').val('');\r\n return;\r\n } else if (geomstack.length == 1)\r\n completeGeom = geomstack[0];\r\n else\r\n completeGeom = new OpenLayers.Geometry.Collection(geomstack);\r\n // the geometry is in the map projection: if this doesn't match indicia's internal one, then must convert.\r\n if (editLayer.map.projection.projcode!='EPSG:900913' && editLayer.map.projection.projcode!='EPSG:3857') \r\n completeGeom.transform(editLayer.map.projection, new OpenLayers.Projection('EPSG:900913'));\r\n jQuery('#imp-geom').val(getwkt(completeGeom, true, true));\r\n setSref(getCentroid(completeGeom));\r\n if(hook_setGeomFields.length > 0)\r\n for(i=0; i< hook_setGeomFields.length; i++)\r\n \t (hook_setGeomFields[i])(completeGeom);\r\n}\r\nremoveDrawnGeom = function(){\r\n var highlighted=gethighlight();\r\n if(highlighted.length > 0) {\r\n unhighlightAll();\r\n }\r\n for(var i=editLayer.features.length-1; i>=0; i--)\r\n editLayer.destroyFeatures([editLayer.features[i]]);\r\n}\r\nreplaceGeom = function(feature, layer, modControl, geom, highlight, setFields){\r\n if(modControl.feature)\r\n modControl.unselectFeature(modControl.feature);\r\n var newfeature = new OpenLayers.Feature.Vector(geom, {});\r\n newfeature.attributes = feature.attributes;\r\n layer.destroyFeatures([feature]);\r\n layer.addFeatures([newfeature]);\r\n modControl.selectFeature(newfeature);\r\n selectFeature.highlight(newfeature);\r\n newfeature.attributes.highlighted=true;\r\n if(setFields) setGeomFields();\r\n}\r\naddAndSelectNewGeom = function(layer, modControl, geom, highlight){\r\n var feature = new OpenLayers.Feature.Vector(geom, {highlighted: false, ours: true});\r\n layer.addFeatures([feature]);\r\n modControl.selectFeature(feature);\r\n feature.attributes.highlighted=true;\r\n selectFeature.highlight(feature);\r\n setGeomFields();\r\n return feature;\r\n}\r\naddToExistingFeatureSet = function(existingFeatures, layer, modControl, geom, highlight){\r\n var feature = new OpenLayers.Feature.Vector(geom, {});\r\n feature.attributes = existingFeatures[0].attributes;\r\n layer.addFeatures([feature]);\r\n modControl.selectFeature(feature);\r\n selectFeature.highlight(feature);\r\n feature.attributes.highlighted=true;\r\n setGeomFields();\r\n}\r\nunhighlightAll = function(){\r\n if(modAreaFeature.feature) modAreaFeature.unselectFeature(modAreaFeature.feature);\r\n var highlighted = gethighlight();\r\n for(var i=0; i<highlighted.length; i++) {\r\n highlighted[i].attributes.highlighted = false;\r\n selectFeature.unhighlight(highlighted[i]);\r\n }\r\n}\r\ngethighlight = function(){\r\n var features=[];\r\n for(var i=0; i<editLayer.features.length; i++){\r\n if(editLayer.features[i].attributes.highlighted==true){\r\n features.push(editLayer.features[i]);\r\n }}\r\n return features;\r\n}\r\n\r\naddDrawnPolygonToSelection = function(geometry) {\r\n var points = geometry.components[0].getVertices();\r\n if(points.length < 3){\r\n alert(\"" . lang::get('LANG_TooFewPoints') . "\");\r\n return false;\r\n }\r\n var highlightedFeatures = gethighlight();\r\n if(highlightedFeatures.length == 0){\r\n // No currently selected feature. Create a new one.\r\n feature = addAndSelectNewGeom(editLayer, modAreaFeature, geometry, true);\r\n \treturn true;\r\n }\r\n var selectedFeature = false;\r\n for(var i=0; i<highlightedFeatures.length; i++){\r\n if(highlightedFeatures[i].geometry.CLASS_NAME == \"OpenLayers.Geometry.Polygon\" ||\r\n highlightedFeatures[i].geometry.CLASS_NAME == \"OpenLayers.Geometry.MultiPolygon\") {\r\n selectedFeature = highlightedFeatures[i];\r\n \t \t\tbreak;\r\n }}\r\n // a site is already selected so the Drawn/Specified state stays unaltered\r\n if(!selectedFeature) {\r\n addToExistingFeatureSet(highlightedFeatures, editLayer, modAreaFeature, geometry, true);\r\n return true;\r\n }\r\n if(selectedFeature.geometry.CLASS_NAME == \"OpenLayers.Geometry.MultiPolygon\") {\r\n if(modAreaFeature.feature)\r\n\t modAreaFeature.unselectFeature(selectedFeature);\r\n selectedFeature.geometry.addComponents([geometry]);\r\n modAreaFeature.selectFeature(selectedFeature);\r\n selectFeature.highlight(selectedFeature);\r\n selectedFeature.attributes.highlighted = true;\r\n setGeomFields();\r\n } else {
|
请发表评论