cartodb/app/model_factories/map_factory.rb
2020-06-15 10:58:47 +08:00

14 lines
347 B
Ruby

module ModelFactories
class MapFactory
def self.get_map(base_layer, user_id, table_id = nil)
provider = ::Map.provider_for_baselayer_kind(base_layer.kind)
options = ::Map::DEFAULT_OPTIONS.merge(user_id: user_id, provider: provider)
options[:table_id] = table_id if table_id
::Map.create(options)
end
end
end