cartodb-4.29/app/helpers/maps_api_helper.rb
2020-06-15 10:58:47 +08:00

15 lines
474 B
Ruby

module MapsApiHelper
def maps_api_template(privacy = 'private')
maps_api_url('{user}', privacy)
end
def maps_api_url(username, privacy = "private")
maps_api = Cartodb.config[:tiler][privacy]
if CartoDB.subdomainless_urls?
maps_api["protocol"] + "://" + maps_api["domain"] + ":" + maps_api["port"].to_s + "/user/#{username}"
else
maps_api["protocol"] + "://#{username}." + maps_api["domain"] + ":" + maps_api["port"].to_s
end
end
end