amap-geoparser
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

AMap GeoParser

GeoParser for AMap(高德地图)

A minimal parser extract from AMap ui/geo/DistrictExplorer.

Usage

npm install amap-geoparser
import GeoParser from 'amap-geoparser'

const parser = new GeoParser()
const areaNode = parser.loadAreaNode(/** adcode **/, /** amap json data **/)

// const parentFeature = areaNode.getParentFeature()
// const subFeatures = areaNode.getSubFeatures()

If you only want to use the parser, you can juse use parseGeoData method.

import { parseGeoData } from 'amap-geoparser'

const geoData = parseGeoData(/** amap json data **/)

API

AreaNode

API description
constructor(adcode: number, data: object);
static getPropsOfFeature(feature): any
static getAdcodeOfFeature(feature): any
static doesFeatureHasChildren(feature): boolean
getIdealZoom(): number
getSubFeatureByIndex(index: number): any
getSubFeatureByAdcode(adcode: number): any
getAdcode(): number
getName(): string
getChildrenNum(): number
getSubFeatures(): any[]
getParentFeature(): any
getParentFeatureInPixel(): any

Readme

Keywords

none

Package Sidebar

Install

npm i amap-geoparser

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

176 kB

Total Files

16

Last publish

Collaborators

  • fredtsang