function leaflet_geojson_source_get_info in Leaflet GeoJSON 7
Same name and namespace in other branches
- 8 leaflet_geojson.module \leaflet_geojson_source_get_info()
- 7.2 leaflet_geojson.module \leaflet_geojson_source_get_info()
2 calls to leaflet_geojson_source_get_info()
- LeafletGeoJSONBean::getSourceOptions in modules/
leaflet_geojson_bean/ plugins/ bean/ leaflet_geojson_bean.inc - LeafletGeoJSONBean::view in modules/
leaflet_geojson_bean/ plugins/ bean/ leaflet_geojson_bean.inc - Displays the bean.
File
- ./
leaflet_geojson.module, line 27 - API Extension for using Leaflet with GeoJSON that currently just allows to add a bbox strategy.
Code
function leaflet_geojson_source_get_info($source = NULL, $skip_cache = FALSE) {
if (!$skip_cache) {
static $drupal_static_fast;
if (!isset($drupal_static_fast)) {
$drupal_static_fast['leaflet_geojson_source_info'] =& drupal_static(__FUNCTION__);
}
$source_info =& $drupal_static_fast['leaflet_geojson_source_info'];
if (empty($source_info)) {
if ($cache = cache_get("leaflet_geojson_source_info")) {
$source_info = $cache->data;
}
}
}
if (empty($source_info)) {
$source_info = module_invoke_all('leaflet_geojson_source_info');
// Let other modules alter the source info.
drupal_alter('leaflet_geojson_source_info', $source_info);
cache_set("leaflet_geojson_source_info", $source_info);
}
if (empty($source)) {
return $source_info;
}
elseif (isset($source_info[$source])) {
return $source_info[$source];
}
}