import Geometry from './Geometry'; /** * GeoJSON工具类 * @english * GeoJSON utilities * @category geometry */ declare const GeoJSON: { /** * 将一个或多个GeoJSON对象转换为几何体 * @english * Convert one or more GeoJSON objects to geometry * @param {String|Object|Object[]} geoJSON - GeoJSON objects or GeoJSON string * @param {Function} [foreachFn=undefined] - callback function for each geometry * @param {Function} [filterFn=undefined] - filter function for each geometry * @return {Geometry|Geometry[]} a geometry array when input is a FeatureCollection * @example * var collection = { * "type": "FeatureCollection", * "features": [ * { "type": "Feature", * "geometry": {"type": "Point", "coordinates": [102.0, 0.5]}, * "properties": {"prop0": "value0"} * }, * { "type": "Feature", * "geometry": { * "type": "LineString", * "coordinates": [ * [102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0] * ] * }, * "properties": { * "prop0": "value0", * "prop1": 0.0 * } * }, * { "type": "Feature", * "geometry": { * "type": "Polygon", * "coordinates": [ * [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], * [100.0, 1.0], [100.0, 0.0] ] * ] * }, * "properties": { * "prop0": "value0", * "prop1": {"this": "that"} * } * } * ] * } * // A geometry array. * const geometries = GeoJSON.toGeometry(collection, geometry => { geometry.config('draggable', true); }); */ toGeometry: (geoJSON: any, foreachFn?: (geo: Geometry) => void, filterFn?: (geo: Geometry) => boolean) => any; /** * async将一个或多个GeoJSON对象转换为几何体 * @english * async Convert one or more GeoJSON objects to geometry * @param {String|Object|Object[]} geoJSON - GeoJSON objects or GeoJSON string * @param {Function} [foreachFn=undefined] - callback function for each geometry * @param {Number} [countPerTime=2000] - Number of graphics converted per time * @param {Function} [filterFn=undefined] - filter function for each geometry * @return {Promise} * @example * GeoJSON.toGeometryAsync(geoJSON).then(geos=>{ * console.log(geos); * }) * */ toGeometryAsync(geoJSON: any, foreachFn?: (geo: Geometry) => void, countPerTime?: number, filterFn?: (geo: Geometry) => boolean): any; /** * 转换单个GeoJSON对象 * @english * Convert single GeoJSON object * @param {Object} geoJSONObj - a GeoJSON object * @return {Geometry} * @private */ _convert: (json: any, foreachFn?: any) => any; _isGeoJSON(json: any): boolean; /** * 正在请求一个大容量的geojson文件。解决主线程阻塞问题 * @english * Requesting a large volume geojson file.Solve the problem of main thread blocking * @param {String} url - GeoJSON file path * @param {Number} [countPerTime=2000] - Number of graphics converted per time * @return {Promise} * @example * GeoJSON.fetch('https://abc.com/file.geojson',2000).then(geojson=>{ * console.log(geojson); * }) * */ fetch(url: any, countPerTime?: number): any; }; export default GeoJSON; //# sourceMappingURL=GeoJSON.d.ts.map