@libeilong/map-js-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.5.1 • Public • Published

map-js-sdk

通用的地图 SDK 封装,统一使用方式

目前拥有功能:

  • 地图 SDK 加载
  • 地图创建
  • 输入提示(自动补全)
  • POI 搜索
import { AMapSDK, TMapSDK, MapModule } from '@libeilong/map-js-sdk'

const instance = new AMapSDK({
  key: '',
  modules: [MapModule.autoComplete, MapModule.placeSearch],
})
// const instance = new TMapSDK({
//   key: '',
//   modules: [MapModule.autoComplete, MapModule.placeSearch],
// })

useEffectLayout(()=>{
  await instance.loadSDK()
  instance.initMap('map', { zoom: 18 })
},[])

return <div id='map'></div>

Readme

Keywords

none

Package Sidebar

Install

npm i @libeilong/map-js-sdk

Weekly Downloads

3

Version

0.5.1

License

MIT

Unpacked Size

20.4 kB

Total Files

21

Last publish

Collaborators

  • libeilong