AMAP
Introduction
The AMAP component is a versatile tool built on the AMAP API for creating geographic information visualizations. It integrates customizable maps, tool plugins, and a diverse marking system to provide an intuitive and professional solution for displaying and analyzing data for location-based services.

Configuration items
Category |
Configuration |
Example |
Description |
Content |
Developer Key |
The developer key. This is the API-KEY from the AMAP Open Platform console. Request a key for the web platform (JS API) in the AMAP management console. For more information, see the AMAP API reference. |
|
Center longitude |
The longitude of the map's current centroid. |
||
Center latitude |
The latitude of the map's current centroid. |
||
Map mode |
The map mode. Select 2D or 3D mode for the base map. In 3D mode, the map supports three-dimensional displays, such as city models. |
||
Map zoom |
The zoom level of the map's current centroid. |
||
Point markers |
|
Configures the point markers on the map. A point marker consists of the following properties:
|
|
Polygon markers |
|
Configures the polygon markers on the map. A polygon marker consists of the following properties:
|
|
Map plugins |
|
Select whether to enable the following plugins on the map:
|
|
Interaction |
Hide |
Hides the component. For more information, see Common properties |
|
Keep layout when hidden |
Keeps the component's layout space when it is hidden. For more information, see Common properties |
||
Style |
Margin |
The margin of the component. For more information, see Common properties |
|
Theme style |
Sets the display style of the base map. For more information, see AMAP Custom Themes. |
Properties and methods
Name |
Type |
Example |
Description |
longitude |
number |
|
The longitude of the map's centroid. |
latitude |
number |
|
The latitude of the map's centroid. |
zoom |
number |
|
The zoom level of the map's centroid. |
markers |
Array<{ id: string; longitude: number; latitude: number; label: string }> |
|
A collection of all point markers on the map. |
polygon |
Array<{ id: string; pathArr: (number, number)[]; strokeStyle: string; fillColor: string; fillOpacity: string; strokeWeight: string; strokeOpacity: string }> |
|
A collection of all polygon markers on the map. |
currentSelectedPointId |
string |
|
The currently selected point marker. |
currentSelectedPolygonId |
string |
|
The currently selected polygon marker. |
clearLongitude |
function |
|
Clears the longitude coordinate of the map's center. |
setLongitude |
func |
|
Sets the longitude coordinate of the map's center. |
clearLatitude |
function |
|
Clears the latitude coordinate of the map's center. |
setLatitude |
function |
|
Sets the latitude coordinate of the map's center. |
clearZoom |
function |
|
Clears the zoom level of the map's center. |
setZoom |
function |
|
Sets the zoom level of the map's center. |
clearCurrentSelectedPointId |
func |
|
Clears the currently selected point marker on the map. |
setCurrentSelectedPointId |
function |
|
Sets the currently selected point marker on the map. |
setCurrentSelectedPolygonId |
function |
|
Sets the currently selected polygon marker on the map. |
clearCurrentSelectedPolygonId |
function |
|
Clears the currently selected polygon marker on the map. |
panTo |
func |
|
Moves the map center to the specified coordinates. |
Event callbacks
Configuration |
Description |
The event that is triggered when a point marker is selected. |
|
The event that is triggered when a polygon marker is selected. |


