# Path: ncdjango/interfaces/arcgis/views.py
# ALLOW_BEST_FIT_TIME_INDEX = getattr(settings, 'NC_ALLOW_BEST_FIT_TIME_INDEX', True)
# TRANSPARENT_BACKGROUND_COLOR = Color(255, 255, 255, 0)
# DEFAULT_BACKGROUND_COLOR = Color(255, 255, 255)
# SUPPORTED_IMAGE_FORMATS = ('PNG', 'PNG8', 'PNG24', 'PNG32', 'JPEG', 'GIF', 'BMP')
# TIME_UNITS_MAP = {
#     'milliseconds': 'esriTimeUnitsMilliseconds',
#     'seconds': 'esriTimeUnitsSeconds',
#     'minutes': 'esriTimeUnitsMinutes',
#     'hours': 'esriTimeUnitsHours',
#     'days': 'esriTimeUnitsDays',
#     'weeks': 'esriTimeUnitsWeeks',
#     'months': 'esriTimeUnitsMonths',
#     'years': 'esriTimeUnitsYears',
#     'decades': 'esriTimeUnitsDecades',
#     'centuries': 'esriTimeUnitsCenturies'
# }
# class MapServiceListView(ListView):
# class MapServiceDetailView(DetailView):
# class LayerListView(ListView):
# class LayerDetailView(DetailView):
# class ArcGISMapServerMixin(object):
# class GetImageView(ArcGISMapServerMixin, GetImageViewBase):
# class IdentifyView(ArcGISMapServerMixin, IdentifyViewBase):
# class LegendView(ArcGISMapServerMixin, LegendViewBase):
#     def render_to_response(self, context, **response_kwargs):
#     def render_to_response(self, context, **response_kwargs):
#     def get_queryset(self):
#     def render_to_response(self, context, **response_kwargs):
#     def get_object(self, queryset=None):
#     def render_to_response(self, context, **response_kwargs):
#     def get_layer_data(variable):
#     def __init__(self, *args, **kwargs):
#     def process_form_data(self, defaults, data):
#     def get_variable_set(self, variable_set, data):
#     def apply_time_to_configurations(self, configurations, data):
#     def _get_form_defaults(self):
#     def get_service_name(self, request, *args, **kwargs):
#     def format_image(self, image, image_format, **kwargs):
#     def get_render_configurations(self, request, **kwargs):
#     def _get_form_defaults(self):
#     def serialize_data(self, data):
#     def get_service_name(self, request, *args, **kwargs):
#     def get_identify_configurations(self, request, **kwargs):
#     def set_legend_sizes(self, configurations):
#     def serialize_data(self, data):
#         def get_legend_elements(elements):
#     def get_service_name(self, request, *args, **kwargs):
#     def get_legend_configurations(self, request, **kwargs):


from ncdjango.interfaces.arcgis import views
from . import forms


class GetImageView(views.GetImageView):
    form_class = forms.GetImageForm

    def get_render_configurations(self, request, **kwargs):
        base_config, configurations = super(GetImageView, self).get_render_configurations(request, **kwargs)
        styles = self.form_data.get('styles')

        if styles:
            for config in configurations:
                config.renderer = styles.get(config.variable.index, config.renderer)

        return base_config, configurations



# Path: ncdjango/interfaces/arcgis/views.py
# ALLOW_BEST_FIT_TIME_INDEX = getattr(settings, 'NC_ALLOW_BEST_FIT_TIME_INDEX', True)
# TRANSPARENT_BACKGROUND_COLOR = Color(255, 255, 255, 0)
# DEFAULT_BACKGROUND_COLOR = Color(255, 255, 255)
# SUPPORTED_IMAGE_FORMATS = ('PNG', 'PNG8', 'PNG24', 'PNG32', 'JPEG', 'GIF', 'BMP')
# TIME_UNITS_MAP = {
#     'milliseconds': 'esriTimeUnitsMilliseconds',
#     'seconds': 'esriTimeUnitsSeconds',
#     'minutes': 'esriTimeUnitsMinutes',
#     'hours': 'esriTimeUnitsHours',
#     'days': 'esriTimeUnitsDays',
#     'weeks': 'esriTimeUnitsWeeks',
#     'months': 'esriTimeUnitsMonths',
#     'years': 'esriTimeUnitsYears',
#     'decades': 'esriTimeUnitsDecades',
#     'centuries': 'esriTimeUnitsCenturies'
# }
# class MapServiceListView(ListView):
# class MapServiceDetailView(DetailView):
# class LayerListView(ListView):
# class LayerDetailView(DetailView):
# class ArcGISMapServerMixin(object):
# class GetImageView(ArcGISMapServerMixin, GetImageViewBase):
# class IdentifyView(ArcGISMapServerMixin, IdentifyViewBase):
# class LegendView(ArcGISMapServerMixin, LegendViewBase):
#     def render_to_response(self, context, **response_kwargs):
#     def render_to_response(self, context, **response_kwargs):
#     def get_queryset(self):
#     def render_to_response(self, context, **response_kwargs):
#     def get_object(self, queryset=None):
#     def render_to_response(self, context, **response_kwargs):
#     def get_layer_data(variable):
#     def __init__(self, *args, **kwargs):
#     def process_form_data(self, defaults, data):
#     def get_variable_set(self, variable_set, data):
#     def apply_time_to_configurations(self, configurations, data):
#     def _get_form_defaults(self):
#     def get_service_name(self, request, *args, **kwargs):
#     def format_image(self, image, image_format, **kwargs):
#     def get_render_configurations(self, request, **kwargs):
#     def _get_form_defaults(self):
#     def serialize_data(self, data):
#     def get_service_name(self, request, *args, **kwargs):
#     def get_identify_configurations(self, request, **kwargs):
#     def set_legend_sizes(self, configurations):
#     def serialize_data(self, data):
#         def get_legend_elements(elements):
#     def get_service_name(self, request, *args, **kwargs):
#     def get_legend_configurations(self, request, **kwargs):


# Path: ncdjango/interfaces/arcgis_extended/views.py
from ncdjango.interfaces.arcgis import views
from . import forms



class GetImageView(views.GetImageView):
    form_class = forms.GetImageForm

    def get_render_configurations(self, request, **kwargs):
        base_config, configurations = super(GetImageView, self).get_render_configurations(request, **kwargs)
        styles = self.form_data.get('styles')

        if styles:
            for config in configurations:
                config.renderer = styles.get(config.variable.index, config.renderer)

        return base_config, configurations



class LegendView(views.LegendView):