工具函数

类型 / 参数 / 返回值 / 用法 · 右侧为本页导航

自定义 本库 API OL OpenLayers 融合 自定义与 OL 混用

工具函数

全局 API · transformCoord

transformCoord(data, from, to, projectionCode?)

import { transformCoord } from '@its-cool/simple-map';

const gcj = transformCoord([120.15, 30.28], 'wgs84', 'gcj02');
const merc = transformCoord(gcj, 'gcj02', 'webmercator');

示例页:/transform


全局 API · mapTools

mapTools.pipeInspection(options)

import { mapTools } from '@its-cool/simple-map';

mapTools.pipeInspection({
  wkid: 3857,
  list: [{ x: 13528400, y: 3676400 }, { x: 13528500, y: 3676500 }],
  layerIds: 'water:pipe',
  callback(rows) {
    console.log(rows);
  }
});