First of all thanks for creating this excellent module. Since I downloading openspace module I have added code so other modules I have can implement it


  foreach (module_implements('openspace_block') as $module) {

        $function1 = $module .'_openspace_block';

        $function1($settings, 'load'); 

      }

Then I have added

CCK fields for northing and easting

Helpers (node) module for values in northing and easting cck fields

And have created new module which implements openspace module and which uses values


function openspacesettings_openspace_block(&$settings, $op) {
 
switch($op) {
 
case 'load':

$settings["openspace"]["easting"] = $node->field_easting[0][value];
$settings["openspace"]["northing"] = $node->field_northing[0][value];

}

}

At this stage I would like to ask a couple of questions.

Is the intention of the openspace module to integrate with geo module so that it uses a values in a cck field integrated with geo API?

The Geo module also mentions about that it can implement values for shape files. I would like it if openspace module could handle Boundary data from Ordnance Survey. I haven't looked at this in any detail at all, but would this need a new vector layer added to module?

Regards

Adrian

Comments

planet4sale’s picture

Add a single boundary layer with default styling syntax. Create new variables in openspace.admin.inc


 $form['openspace_admin_unit_id'] = array(
    '#type' => 'textfield',
    '#title' => t('admin_unit_id'),
    '#default_value' => $block_info['admin_unit_id'],
    '#size' => 10,
    '#description' => t('This is the admin_unit_id value for the block.'),
  );
  $form['openspace_area_code'] = array(
    '#type' => 'textfield',
    '#title' => t('area_code'),
    '#default_value' => $block_info['area_code'],
    '#size' => 10,
    '#description' => t('This is area_code value for the block.'),
  );  

$block_info['admin_unit_id'] = check_plain($edit['openspace_admin_unit_id']);
  $block_info['area_code'] = check_plain($edit['openspace_area_code']);

Create new cck fields to match, and add these to node in new module implementing openspace_block:


$node = node_load_current();
		
		$settings["openspace"]["admin_unit_ids"] = $node->field__admin_unit_ids[0][value];
		$settings["openspace"]["area_code"] = $node->field_area_code[0][value];  

Add variables to openspace.js


var options = {strategies: [new OpenSpace.Strategy.BBOX()],admin_unit_ids: [openspace_settings.admin_unit_ids],
       area_code: [openspace_settings.area_code]
                                  };
				  boundaryLayer = new OpenSpace.Layer.Boundary("Boundaries", options);
    osMap.addLayer(boundaryLayer);		

To change the colour of the administrative boundary modify openspace.js following advice http://openspace.ordnancesurvey.co.uk/openspace/developerarea.html

Boudary data is available at: http://openspace.ordnancesurvey.co.uk/openspaceforum/thread.jspa?threadI...