import type { LonLatArray } from './MapViewOptions'; import type MapPointOptions from '../Series/Map/MapPointOptions'; export interface BaseGeometry { arcs?: (number[] | number[][] | number[][][]); properties?: Record; } /** * A latitude/longitude object. */ export interface MapLonLatObject { /** * The latitude. */ lat: number; /** * The longitude. */ lon: number; } export interface MultiPoint extends BaseGeometry { type: 'MultiPoint'; coordinates: LonLatArray[]; } export interface LineString extends BaseGeometry { type: 'LineString'; coordinates: LonLatArray[]; } export interface Polygon extends BaseGeometry { type: 'Polygon'; coordinates: LonLatArray[][]; } export interface MultiLineString extends BaseGeometry { type: 'MultiLineString'; coordinates: LonLatArray[][]; } export interface MultiPolygon extends BaseGeometry { type: 'MultiPolygon'; coordinates: LonLatArray[][][]; } export interface GeoJSONGeometryMultiPointRegistry { LineString: LineString; MultiPoint: MultiPoint; Polygon: Polygon; MultiLineString: MultiLineString; MultiPolygon: MultiPolygon; } export type GeoJSONGeometryMultiPoint = GeoJSONGeometryMultiPointRegistry[keyof GeoJSONGeometryMultiPointRegistry]; /** * Represents the loose structure of a geographic JSON file. * * @interface Highcharts.GeoJSON */ export interface GeoJSON { /** * Short copyright note of the geographic data suitable for watermarks. * * @name Highcharts.GeoJSON#copyrightShort * @type {string|undefined} */ copyrightShort?: string; /** * Additional meta information based on the coordinate reference system. * * @name Highcharts.GeoJSON#crs * @type {Highcharts.Dictionary|undefined} */ crs?: AnyRecord; /** * Data sets of geographic features. * * @name Highcharts.GeoJSON#features * @type {Array} */ features: Array; /** * Map projections and transformations to be used when calculating between * lat/lon and chart values. Required for lat/lon support on maps. Allows * resizing, rotating, and moving portions of a map within its projected * coordinate system while still retaining lat/lon support. If using lat/lon * on a portion of the map that does not match a `hitZone`, the definition * with the key `default` is used. * * @name Highcharts.GeoJSON#hc-transform * @type {Highcharts.Dictionary|undefined} */ 'hc-transform'?: Record; /** * Title of the geographic data. * * @name Highcharts.GeoJSON#title * @type {string|undefined} */ title?: string; /** * Type of the geographic data. Type of an optimized map collection is * `FeatureCollection`. * * @name Highcharts.GeoJSON#type * @type {string|undefined} */ type: 'FeatureCollection'; /** * Version of the geographic data. * * @name Highcharts.GeoJSON#version * @type {string|undefined} */ version?: string; } /** * Data set of a geographic feature. * * @interface Highcharts.GeoJSONFeature * @extends Highcharts.Dictionary<*> */ export interface GeoJSONFeature { /** * Data type of the geographic feature. * @name Highcharts.GeoJSONFeature#type * @type {string} */ type: 'Feature'; } /** * Describes the map projection and transformations applied to a portion of * a map. * @interface Highcharts.GeoJSONTranslation */ export interface GeoJSONTransform { /** * The coordinate reference system used to generate this portion of the map. * * @name Highcharts.GeoJSONTranslation#crs * @type {string} */ crs?: string; /** * Define the portion of the map that this definition applies to. Defined as * a GeoJSON polygon feature object, with `type` and `coordinates` * properties. * * @name Highcharts.GeoJSONTranslation#hitZone * @type {Highcharts.Dictionary<*>|undefined} */ hitZone?: AnyRecord; /** * Property for internal use for maps generated by Highsoft. * * @name Highcharts.GeoJSONTranslation#jsonmarginX * @type {number|undefined} */ jsonmarginX?: number; /** * Property for internal use for maps generated by Highsoft. * * @name Highcharts.GeoJSONTranslation#jsonmarginY * @type {number|undefined} */ jsonmarginY?: number; /** * Property for internal use for maps generated by Highsoft. * * @name Highcharts.GeoJSONTranslation#jsonres * @type {number|undefined} */ jsonres?: number; /** * Specifies clockwise rotation of the coordinates after the projection, but * before scaling and panning. Defined in radians, relative to the * coordinate system origin. * * @name Highcharts.GeoJSONTranslation#rotation * @type {number|undefined} */ rotation?: number; /** * The scaling factor applied to the projected coordinates. * * @name Highcharts.GeoJSONTranslation#scale * @type {number|undefined} */ scale?: number; /** * Property for internal use for maps generated by Highsoft. * * @name Highcharts.GeoJSONTranslation#xoffset * @type {number|undefined} */ xoffset?: number; /** * X offset of projected coordinates after scaling. * * @name Highcharts.GeoJSONTranslation#xpan * @type {number|undefined} */ xpan?: number; /** * Property for internal use for maps generated by Highsoft. * * @name Highcharts.GeoJSONTranslation#yoffset * @type {number|undefined} */ yoffset?: number; /** * Y offset of projected coordinates after scaling. * * @name Highcharts.GeoJSONTranslation#ypan * @type {number|undefined} */ ypan?: number; } /** * A TopoJSON object, see description on the * [project's GitHub page](https://github.com/topojson/topojson). * * @typedef {Object} Highcharts.TopoJSON */ export interface TopoJSON { } /** * An array of GeoJSON or TopoJSON objects or strings used as map data for * series. * * @typedef {Array<*>|Highcharts.GeoJSON|Highcharts.TopoJSON|string} Highcharts.MapDataType */ export type MapDataType = Array | GeoJSON | TopoJSON | string; export default GeoJSON;