Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add api key docs #6

Merged
merged 13 commits into from
Jan 21, 2017
Merged

add api key docs #6

merged 13 commits into from
Jan 21, 2017

Conversation

kkowalsky
Copy link
Collaborator

fixes #2

@nvkelso I put the examples for Tangram JS and the YAML syntax together in the API Reference as it makes more sense. I could add it to 'Get Started' as well, but I don't think it's necessary.

still unsure if the default = false?

@nvkelso
Copy link
Member

nvkelso commented Nov 17, 2016

This is aspirational at the moment since no house style currently supports this API method.

Once they do, we can merge this.

We should probably add a bullet point to each house style in styles.md saying that it's not yet supported? (And when it is we'll move that bullet point to the supported column?)

});
```

In the Tangram YAML file:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't include any other Tangram YAML file snippets for the other API methods. Recommend removing this title and code block.

As the basemaps are still in active development we recommend peggging an import to a specific major version, eg: `5`. See the [versioning](versioning.md) doc for more details.
As the basemaps are still in active development we recommend pegging an import to a specific major version, eg: `5`. See the [versioning](versioning.md) doc for more details.

## Global API keys
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Global API keys or Mapzen API keys? Mapzen should either be in the section header or/& also in the paragraph text.

@nvkelso
Copy link
Member

nvkelso commented Nov 17, 2016

Yes, the default will be false – which means the style would only have access to anonymous rate limits + cached tiles.


## Mapzen API keys

API keys can be set as a global variable which allows you to easily change them when starting a new project or updating your key. As API keys are not set to a particular product, you can use the same key for using both vector and terrain tile services. This is set in Tangram JS and updates the YAML files as a global variable.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a generic Tangram feature, not constrained to JS.

@kkowalsky
Copy link
Collaborator Author

just noticed that https://mapzen.com/documentation/tangram/android-walkthrough/#using-mapzens-vector-tile-service uses this already in the walkthrough...


## Mapzen API keys

API keys can be set as a global variable which allows you to easily change them when starting a new project or updating your key. As API keys are not set to a particular product, you can use the same key for using both vector and terrain tile services. This is set in Tangram and updates the YAML files as a global variable.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API keys should be set using the global variable

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also link to getting an API key...

Sign up for a Mapzen API key to enjoy higher rate limits...


### sdk_api_key

* `sdk_api_key`: defaults to `false`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defaults to ''


Example Tangram usage:
```
globals:
Copy link
Member

@nvkelso nvkelso Jan 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tangram JS

 var layer = Tangram.leafletLayer({
        scene: { import: style_file, global: { sdk_mapzen_api_key: 'mapzen-xxxxxx' } },
        attribution: '<a href="https://mapzen.com/tangram" target="_blank">Tangram</a> | &copy; OSM contributors | <a href="https://mapzen.com/" target="_blank">Mapzen</a>'
    });

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the Tangram ES version:

map->loadScene(
    "https://mapzen.com/carto/bubble-wrap-style/bubble-wrap.yaml",
    false,
    { "global.sdk_mapzen_api_key", "mapzen-xxxxxx" }
);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waiting for Mapzen.js version (should be available next week).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Remove the snippet of source code, that's internal logic the user shouldn't worry about.)

@nvkelso nvkelso merged commit 7c35368 into master Jan 21, 2017
@nvkelso nvkelso deleted the api-key branch January 21, 2017 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add description on how to set API key per style
2 participants