BingMapsApi.js 827 B

1234567891011121314151617181920212223242526272829
  1. import defined from './defined.js';
  2. /**
  3. * Object for setting and retrieving the default Bing Maps API key.
  4. *
  5. * A Bing API key is only required if you are using {@link BingMapsImageryProvider}
  6. * or {@link BingMapsGeocoderService}. You can create your own key at
  7. * {@link https://www.bingmapsportal.com/}.
  8. *
  9. * @exports BingMapsApi
  10. */
  11. var BingMapsApi = {};
  12. /**
  13. * The default Bing Maps API key to use if one is not provided to the
  14. * constructor of an object that uses the Bing Maps API.
  15. *
  16. * @type {String}
  17. */
  18. BingMapsApi.defaultKey = undefined;
  19. BingMapsApi.getKey = function(providedKey) {
  20. if (defined(providedKey)) {
  21. return providedKey;
  22. }
  23. return BingMapsApi.defaultKey;
  24. };
  25. export default BingMapsApi;