GeoParser for AMap(高德地图)
A minimal parser extract from AMap ui/geo/DistrictExplorer.
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 | 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 |