{% load api_basemaps_tags %}

<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}geoexplorer/externals/geoext/resources/css/geoext-all.css?v={{ VERSION }}" />
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}geoexplorer/externals/geoext/resources/css/gxtheme-gray.css?v={{ VERSION }}">
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}geoexplorer/theme/ux/colorpicker/color-picker.ux.css?v={{ VERSION }}" />
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}geoexplorer/externals/printpreview/resources/css/printpreview.css?v={{ VERSION }}" />
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}geoexplorer/externals/openlayers/theme/default/style.css?v={{ VERSION }}" />
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}geoexplorer/externals/gxp/src/theme/all.css?v={{ VERSION }}" />
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}geoexplorer/theme/app/geoexplorer.css?v={{ VERSION }}" />
<!--[if IE]><link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}geoexplorer/theme/app/ie.css"/><![endif]-->

<script src="https://maps.googleapis.com/maps/api/js?key={% google_api_key %}" type="text/javascript"></script>

<script src="{{STATIC_URL}}geoexplorer/script/GeoExplorer.js?v={{ VERSION }}" type="text/javascript"></script>
<script type="text/javascript">
OpenLayers.ImgPath = "{{ STATIC_URL }}geoexplorer/externals/openlayers/theme/default/img";
OpenLayers.Request.DEFAULT_CONFIG.headers = {
  'X-CSRFToken': '{{ csrf_token|escapejs }}'
};

/**
*  Add GetFeedFeatureInfo tool to GeoExplorer.Viewer
*/
GeoExplorer.Viewer.prototype.loadConfig = function(config) {
  // remove the 3D Viewer if no Google API Key is availbale
  var google_api_key = '{% google_api_key %}';
  if(google_api_key.length == 0 || 'None' == google_api_key) {
    config.viewerTools.splice(10,1);
  }

  /* - TEMPORARLY DISABLED GXPLORER PLAYBACK -
    config.viewerTools.push({
      ptype: "gxp_playback",
      checked: true,
      outputTarget: "paneltbar"
    });
  */

GeoExplorer.Viewer.superclass.loadConfig.call(this, config);
};

GeoExplorer.Composer.prototype.loadConfig = function(config) {
  // remove the 3D Viewer if no Google API Key is availbale
  var google_api_key = '{% google_api_key %}';
  if(google_api_key.length == 0 || 'None' == google_api_key) {
    config.tools.splice(6,1);
  }

  GeoExplorer.Composer.superclass.loadConfig.call(this, config);
};

</script>
