variable_get('mapstraction_api_'. $api_id, '')));
return '';
}
function mapstraction_yahoo_render($settings) {
$src = 'http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=' . variable_get('mapstraction_api_'. $api_id, '');
return '';
}
function mapstraction_microsoft_render() {
$src = 'http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6';
return '';
}
function mapstraction_freeearth_render() {
$src = 'http://freeearth.poly9.com/api.js';
return '';
}
function mapstraction_cloudmade_settings_form($settings) {
$form = array();
$form['style_id'] = array(
'#type' => 'textfield',
'#title' => t('Map Style ID'),
'#size' => 40,
'#maxlength' => 255,
'#default_value' => $settings['style_id'],
'#process' => array('views_process_dependency'),
'#dependency' => array(
'edit-style-options-api' => array('cloudmade'),
),
);
return $form;
}
function mapstraction_cloudmade_render($settings, $api_id, $id) {
$output = mapstraction_openlayers_render($settings);
$src = base_path() . drupal_get_path('module', 'mapstraction') . '/cloudmade.js';
$output .= "\n";
$js = '
$(document).ready(function() {
var cloudmade = new OpenLayers.Layer.CloudMade("CloudMade", {
key: "' . variable_get('mapstraction_api_'. $api_id, '') . '",
styleId: ' . $settings['style_id'] . ',
});
Drupal.mapstraction["' . $id . '"].maps["openlayers"].addLayer(cloudmade);
Drupal.mapstraction["' . $id . '"].maps["openlayers"].setBaseLayer(cloudmade);
});';
drupal_add_js($js, 'inline', 'footer');
return $output;
}
function mapstraction_openlayers_render($settings) {
$src = 'http://openlayers.org/api/OpenLayers.js';
return "\n";
}