Skip to content

geo-types-czTypeScript GeoJSON 类型定义包

🌍 专为前端 GIS 开发设计的完整类型定义

geo-types-cz

快速预览

typescript
import { 
  Point, 
  Feature, 
  createFeature, 
  calculateDistance 
} from 'geo-types-cz'

// 创建点几何
const point: Point = {
  type: 'Point',
  coordinates: [116.3974, 39.9093] // 北京天安门
}

// 创建要素
const feature = createFeature(point, {
  name: '天安门',
  city: '北京'
})

// 计算两点间距离
const distance = calculateDistance(
  [116.3974, 39.9093], // 天安门
  [121.4737, 31.2304]  // 上海外滩
)

console.log(`距离: ${Math.round(distance / 1000)}公里`)

为什么选择 geo-types-cz?

🚀 开发效率

完整的 TypeScript 类型定义让你在编写 GIS 应用时享受智能提示和类型检查,大大提高开发效率。

🔒 类型安全

严格的类型约束帮助你在编译时发现潜在问题,避免运行时错误。

📚 丰富的功能

不仅提供标准的 GeoJSON 类型,还扩展了样式、图层、查询等实用功能。

🌐 国际化支持

特别针对中国用户优化,支持常用的中国坐标系和完整的中文文档。

立即开始

bash
npm install geo-types-cz

社区

Released under the MIT License.