from rest_framework import serializers

from smoothglue.core.serializers.dynamic import DynamicModelSerializer
from smoothglue.map.models import ImageryLayer


class ImageryLayerSerializer(DynamicModelSerializer):

    provider_type = serializers.CharField(
        source="get_provider_type_display", read_only=True
    )

    class Meta:
        model = ImageryLayer
        fields = ["id", "name", "url", "provider_type", "sort_order", "is_active"]
