Document Maps JavaScript API Reference Manual Vector Graphics GeoJSON

GeoJSON

AMap.GeoJSON

The GeoJSON class, inheriting from OverLayGroup, enables mutual conversion between GeoJSON objects and OverlayGroup. Construct a GeoJSON object, specifying the rectangle style through GeoJSONOptions

new AMap.GeoJSON(opts: GeoJSONOptions)

Parameter

opts (GeoJSONOptions)Create a GeoJSON object, with opts as the initial construction parameters

Attribute

Type

Description

geoJSON

Object

The standard GeoJSON object to be loaded

getMarker

function (geojson, lnglat)

Specify the drawing method of the point feature, defaulting to the default style of Marker. geojson is the corresponding GeoJSON object of the current feature, and lnglats is the location of the corresponding point

getPolyline

function (geojson, lnglat)

Specify the drawing method of the line feature, defaulting to the default style of Polyline. geojson is the corresponding GeoJSON object of the current feature, and lnglats is the path of the corresponding line

getPolygon

function (geojson, lnglat)

Specify the drawing method of the polygon feature, which defaults to the default style of Polygon. geojson is the GeoJSON object corresponding to the current feature, and lnglats is the path of the corresponding polygon

Method

importData(geoJSON)

Load a new GeoJSON object, convert it into overlays, and remove the old overlays

ParametergeoJSON (anyGeoJSON object

geoJSON (any)

Convert the overlays contained in the current object to GeoJSON objects

return value: (Object) GeoJSON object