@maptiler/client 1.0.3 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/maptiler-client.cjs +465 -21
  2. package/dist/maptiler-client.cjs.map +1 -1
  3. package/dist/maptiler-client.d.ts +395 -2
  4. package/dist/maptiler-client.min.mjs +1 -1
  5. package/dist/maptiler-client.mjs +461 -22
  6. package/dist/maptiler-client.mjs.map +1 -1
  7. package/dist/maptiler-client.umd.js +465 -21
  8. package/dist/maptiler-client.umd.js.map +1 -1
  9. package/dist/maptiler-client.umd.min.js +1 -1
  10. package/docs/assets/custom.css +28 -1
  11. package/docs/classes/config.ClientConfig.html +9 -9
  12. package/docs/classes/services_ServiceError.ServiceError.html +7 -7
  13. package/docs/functions/language.getAutoLanguageGeocoding.html +5 -5
  14. package/docs/functions/services_simplify.default.html +5 -5
  15. package/docs/index.html +98 -10
  16. package/docs/modules/config.html +5 -5
  17. package/docs/modules/language.html +5 -5
  18. package/docs/modules/services_ServiceError.html +5 -5
  19. package/docs/modules/services_coordinates.html +5 -5
  20. package/docs/modules/services_data.html +5 -5
  21. package/docs/modules/services_geocoding.html +5 -5
  22. package/docs/modules/services_geolocation.html +5 -5
  23. package/docs/modules/services_simplify.html +5 -5
  24. package/docs/modules/services_staticMaps.html +5 -5
  25. package/docs/modules.html +4 -4
  26. package/docs/types/config.FetchFunction.html +5 -5
  27. package/docs/types/language.LanguageGeocodingString.html +5 -5
  28. package/docs/types/services_coordinates.CoordinateExport.html +5 -5
  29. package/docs/types/services_coordinates.CoordinateGrid.html +5 -5
  30. package/docs/types/services_coordinates.CoordinateId.html +5 -5
  31. package/docs/types/services_coordinates.CoordinateSearch.html +5 -5
  32. package/docs/types/services_coordinates.CoordinateSearchResult.html +5 -5
  33. package/docs/types/services_coordinates.CoordinateTransformResult.html +5 -5
  34. package/docs/types/services_coordinates.CoordinateTransformation.html +5 -5
  35. package/docs/types/services_coordinates.CoordinatesSearchOptions.html +5 -5
  36. package/docs/types/services_coordinates.CoordinatesTransformOptions.html +5 -5
  37. package/docs/types/services_coordinates.XYZ.html +5 -5
  38. package/docs/types/services_data.GetDataOptions.html +5 -5
  39. package/docs/types/services_geocoding.Coordinates.html +5 -5
  40. package/docs/types/services_geocoding.FeatureHierarchy.html +5 -5
  41. package/docs/types/services_geocoding.GeocodingFeature.html +5 -5
  42. package/docs/types/services_geocoding.GeocodingOptions.html +5 -5
  43. package/docs/types/services_geocoding.GeocodingSearchResult.html +5 -5
  44. package/docs/types/services_geocoding.ReverseGeocodingOptions.html +5 -5
  45. package/docs/types/services_geolocation.GeolocationInfoOptions.html +5 -5
  46. package/docs/types/services_geolocation.GeolocationResult.html +5 -5
  47. package/docs/types/services_staticMaps.AutomaticStaticMapOptions.html +5 -5
  48. package/docs/types/services_staticMaps.BoundedStaticMapOptions.html +5 -5
  49. package/docs/types/services_staticMaps.CenteredStaticMapOptions.html +5 -5
  50. package/docs/types/services_staticMaps.StaticMapBaseOptions.html +7 -7
  51. package/docs/types/services_staticMaps.StaticMapMarker.html +5 -5
  52. package/docs/variables/config.config.html +5 -5
  53. package/docs/variables/language.LanguageGeocoding.html +5 -5
  54. package/docs/variables/services_coordinates.coordinates.html +5 -5
  55. package/docs/variables/services_data.data.html +5 -5
  56. package/docs/variables/services_geocoding.geocoding.html +5 -5
  57. package/docs/variables/services_geolocation.geolocation.html +5 -5
  58. package/docs/variables/services_staticMaps.staticMaps.html +5 -5
  59. package/docsmd/README.md +143 -36
  60. package/docsmd/assets/custom.css +28 -1
  61. package/docsmd/classes/ClientConfig.md +5 -5
  62. package/docsmd/classes/MapStyleVariant.md +217 -0
  63. package/docsmd/classes/ReferenceMapStyle.md +169 -0
  64. package/docsmd/classes/ServiceError.md +3 -3
  65. package/examples/test-browser-umd.html +1 -1
  66. package/package.json +1 -1
  67. package/readme.md +64 -5
  68. package/src/index.ts +17 -0
  69. package/src/mapstyle.ts +841 -0
  70. package/src/services/staticMaps.ts +5 -4
  71. package/tsconfig.json +0 -1
  72. package/typedoc.css +28 -1
@@ -1,6 +1,7 @@
1
1
  import { BBox, Position } from "geojson";
2
2
  import { config } from "../config";
3
3
  import { defaults } from "../defaults";
4
+ import { MapStyleVariant, ReferenceMapStyle, styleToStyle } from "../mapstyle";
4
5
  import simplify from "./simplify";
5
6
 
6
7
  /**
@@ -16,7 +17,7 @@ export type StaticMapBaseOptions = {
16
17
  * Style of the map (not full style URL). Example: "winter", "streets-v2".
17
18
  * Default: `"streets-v2"`
18
19
  */
19
- style?: string;
20
+ style?: string | ReferenceMapStyle | MapStyleVariant;
20
21
 
21
22
  /**
22
23
  * Double the size of the static map image to support hiDPI/Retina monitors.
@@ -200,7 +201,7 @@ function centered(
200
201
  zoom: number,
201
202
  options: CenteredStaticMapOptions = {}
202
203
  ): string {
203
- const style = options.style ?? defaults.mapStyle;
204
+ const style = styleToStyle(options.style);
204
205
  const scale = options.hiDPI ? "@2x" : "";
205
206
  const format = options.format ?? "png";
206
207
  let width = ~~(options.width ?? 1024);
@@ -284,7 +285,7 @@ function bounded(
284
285
  boundingBox: BBox,
285
286
  options: BoundedStaticMapOptions = {}
286
287
  ): string {
287
- const style = options.style ?? defaults.mapStyle;
288
+ const style = styleToStyle(options.style);
288
289
  const scale = options.hiDPI ? "@2x" : "";
289
290
  const format = options.format ?? "png";
290
291
  let width = ~~(options.width ?? 1024);
@@ -374,7 +375,7 @@ function automatic(options: AutomaticStaticMapOptions = {}): string {
374
375
  );
375
376
  }
376
377
 
377
- const style = options.style ?? defaults.mapStyle;
378
+ const style = styleToStyle(options.style);
378
379
  const scale = options.hiDPI ? "@2x" : "";
379
380
  const format = options.format ?? "png";
380
381
  let width = ~~(options.width ?? 1024);
package/tsconfig.json CHANGED
@@ -6,5 +6,4 @@
6
6
  "allowSyntheticDefaultImports": true,
7
7
  "resolveJsonModule": true
8
8
  }
9
-
10
9
  }
package/typedoc.css CHANGED
@@ -1,4 +1,27 @@
1
-
1
+ /* Overiding the default dark mode with color scheme from the light mode */
2
+ @media (prefers-color-scheme: dark) {
3
+ :root {
4
+ --color-background: var(--light-color-background);
5
+ --color-background-secondary: var(--light-color-background-secondary);
6
+ --color-background-warning: var(--light-color-background-warning);
7
+ --color-warning-text: var(--light-color-warning-text);
8
+ --color-icon-background: var(--light-color-icon-background);
9
+ --color-accent: var(--light-color-accent);
10
+ --color-text: var(--light-color-text);
11
+ --color-text-aside: var(--light-color-text-aside);
12
+ --color-link: var(--light-color-link);
13
+ --color-ts: var(--light-color-ts);
14
+ --color-ts-interface: var(--light-color-ts-interface);
15
+ --color-ts-enum: var(--light-color-ts-enum);
16
+ --color-ts-class: var(--light-color-ts-class);
17
+ --color-ts-function: var(--light-color-ts-function);
18
+ --color-ts-namespace: var(--light-color-ts-namespace);
19
+ --color-ts-private: var(--light-color-ts-private);
20
+ --color-ts-variable: var(--light-color-ts-variable);
21
+ --external-icon: var(--light-external-icon);
22
+ --color-scheme: var(--light-color-scheme);
23
+ }
24
+ }
2
25
 
3
26
  body {
4
27
  background: #fff;
@@ -59,6 +82,10 @@ h6, .h6, h5, .h5, h4, .h4, h3, .h3, h2, .h2, h1, .h1 {
59
82
  display: none;
60
83
  }
61
84
 
85
+ .tsd-navigation a {
86
+ color: #252525;
87
+ }
88
+
62
89
  .tsd-navigation.primary ul li a:hover {
63
90
  border-color: #b3deff;
64
91
  }