#ifndef __TN_TILE_PROVIDER_H__
#define __TN_TILE_PROVIDER_H__

#include <foundation/SharedPtr.h>
#include <RenderEngine/TnMapRasterTileData.h>

class TnTileProvider
{
public:
    // Shared ptr
    typedef Tn::Foundation::shared_ptr<TnTileProvider> ptr;
    
    // Named constructor (factory)
    struct ProviderInfo
    {
        TnMapRasterTileData::eProviderType type;
        std::string APIKey;
    };
    static ptr ChooseProvider(ProviderInfo const & providerInfo);
    
    // Fill in RasterTileImageData, and set the request result
    virtual void GetTilesFor(TnMapRasterTileData::ptr const & data, int zoomBias) = 0;// The more negative, the more blurry.  
                                                                                      // Default in json should be -1
    TnMapRasterTileData::eProviderType ProviderType() const;
    
protected:
    // Callers must use named constructor
    TnTileProvider(TnMapRasterTileData::eProviderType type);
    virtual ~TnTileProvider();
    
private:
    TnMapRasterTileData::eProviderType m_providerType;
};

#endif

