-
Notifications
You must be signed in to change notification settings - Fork 3
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
Conversation
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 |
}); | ||
``` | ||
|
||
In the Tangram YAML file: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
Yes, the default will be |
|
||
## 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. |
There was a problem hiding this comment.
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.
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. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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` |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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> | © OSM contributors | <a href="https://mapzen.com/" target="_blank">Mapzen</a>'
});
There was a problem hiding this comment.
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" }
);
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.)
…her formatting and examples
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?