cartodb-4.42/app/model_factories/map_factory.rb

14 lines
347 B
Ruby
Raw Normal View History

2024-04-06 13:25:13 +08:00
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