783c0dc18b58450af4ec2e2753234cf3d8a994f568aa375a229c06594183c45d7837184ca9a7298b288cf214f5d12fa653efc8bd109f7792d3f77621e3847c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import { GeoJSONSourceInput, GeoResource, GeoSpecialAreas, NameMap, GeoSVGSourceInput } from './geoTypes.js';
  2. import { GeoJSONResource } from './GeoJSONResource.js';
  3. declare type MapInput = GeoJSONMapInput | SVGMapInput;
  4. interface GeoJSONMapInput {
  5. geoJSON: GeoJSONSourceInput;
  6. specialAreas: GeoSpecialAreas;
  7. }
  8. interface SVGMapInput {
  9. svg: GeoSVGSourceInput;
  10. }
  11. declare const _default: {
  12. /**
  13. * Compatible with previous `echarts.registerMap`.
  14. *
  15. * @usage
  16. * ```js
  17. *
  18. * echarts.registerMap('USA', geoJson, specialAreas);
  19. *
  20. * echarts.registerMap('USA', {
  21. * geoJson: geoJson,
  22. * specialAreas: {...}
  23. * });
  24. * echarts.registerMap('USA', {
  25. * geoJSON: geoJson,
  26. * specialAreas: {...}
  27. * });
  28. *
  29. * echarts.registerMap('airport', {
  30. * svg: svg
  31. * }
  32. * ```
  33. *
  34. * Note:
  35. * Do not support that register multiple geoJSON or SVG
  36. * one map name. Because different geoJSON and SVG have
  37. * different unit. It's not easy to make sure how those
  38. * units are mapping/normalize.
  39. * If intending to use multiple geoJSON or SVG, we can
  40. * use multiple geo coordinate system.
  41. */
  42. registerMap: (mapName: string, rawDef: MapInput | GeoJSONSourceInput, rawSpecialAreas?: GeoSpecialAreas) => void;
  43. getGeoResource(mapName: string): GeoResource;
  44. /**
  45. * Only for exporting to users.
  46. * **MUST NOT** used internally.
  47. */
  48. getMapForUser: (mapName: string) => ReturnType<GeoJSONResource['getMapForUser']>;
  49. load: (mapName: string, nameMap: NameMap, nameProperty: string) => ReturnType<GeoResource['load']>;
  50. };
  51. export default _default;