From 7c13561a4f7373504efc3bd7e0d5ff9ea94b107b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 24 Aug 2018 13:28:53 +0200 Subject: [PATCH] Add jsonp named map instantiation endpoint --- docs/reference/swagger.yaml | 57 +++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 22 deletions(-) diff --git a/docs/reference/swagger.yaml b/docs/reference/swagger.yaml index e58b8367..b2ee06d9 100644 --- a/docs/reference/swagger.yaml +++ b/docs/reference/swagger.yaml @@ -74,7 +74,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/AnonymousMapResponse' + $ref: '#/components/schemas/MapResponse' '401': $ref: '#/components/responses/Unauthorized' '403': @@ -482,17 +482,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TemplateInstantiationResponse' - example: - layergroupid: 'docs@fd2861af@c01a54877c62831bb51720263f91fb33:123456788' - last_updated: '2013-11-14T11:20:15.000Z' - '401': - $ref: '#/components/responses/Unauthorized' - '403': - $ref: '#/components/responses/Forbidden' - security: - - ApiKeyQueryParam: [] - - ApiKeyHTTPBasicAuth: [] + $ref: '#/components/schemas/MapResponse' x-code-samples: - lang: Curl source: | @@ -504,6 +494,38 @@ paths: }' \ 'https://{username}.carto.com/api/v1/map/named/{template_name}?auth_token={auth_token}' '/map/named/{template_name}/jsonp': + get: + summary: Instantiate a Named Map using JSONP + description: Instantiating a Named Map allows you to fetch the map tiles. The result is an Anonymous Map + tags: + - Named Maps + parameters: + - $ref: '#/components/parameters/templateName' + - in: query + name: auth_token + description: > + `"token"` or `"open"` ("open" is the default if not specified. Use "token" to password-protect your map) + schema: + type: string + - in: query + name: config + description: > + Encoded JSON with the params (variables) needed for the Named Map + schema: + type: string + - in: query + name: callback + description: > + JSON callback name + schema: + type: string + responses: + '200': + description: Ok. You can then use the layergroupid for fetching tiles and grids as you would normally + content: + application/json: + schema: + $ref: '#/components/schemas/MapResponse' '/map/static/center/{layergroupid}/{z}/{lat}/{lng}/{width}/{height}.{format}': get: parameters: @@ -1003,7 +1025,7 @@ components: * **http** - load tiles over HTTP * **plain** - color or background image url * **named** - use a Named Map as a layer - AnonymousMapResponse: + MapResponse: type: object properties: layergroupid: @@ -1168,15 +1190,6 @@ components: items: type: string description: template name - TemplateInstantiationResponse: - type: object - title: Template Instantiation Response - poperties: - layergroupid: - type: string - last_updated: - type: string - format: date-time securitySchemes: ApiKeyHTTPBasicAuth: type: http