Attribute | Type | Default value | Required | Description | iOS Compatibility | Android Compatibility | IDE Compatibility | | |
type | string | tencent | No | Map Type: Tencent or Google | No | No | Yes | | |
longitude | number | - | Yes | Central Longitude | Yes | Yes | Yes | | |
latitude
| number | - | Yes | Central Latitude | Yes | Yes | Yes | | |
scale | number | 16 | No | Scaling level, ranging from 3 to 20. | Yes | Yes | Yes | | |
min-scale | number | 3 | No | Minimum scaling level | | Yes | Yes | | |
max-scale | number | 20 | No | Maximum scaling level | | Yes | Yes | | |
markers | array.<marker> | - | No | Marker Point | Yes | Yes | Yes | | |
polyline | array.<polyline> | - | No | Route | Yes | Yes | Yes | | |
circles | array.<circle> | - | No | Circle | Yes | Yes | Yes | | |
controls | array.<control> | - | No | Widget | No | No | No | | |
include-points | array.<point> | - | No | Scale the view to contain all given coordinate points. | Yes | Yes | Yes | | |
show-location
| boolean
| false | No | Display the current location point with direction. | Yes | Yes | Yes | | |
polygons | array.<polygon> | - | No | Polygon | Yes | Yes |
Yes
| | |
subkey | string | - | No | Key used for personalized map customization. | No | No |
Of type 'Tencent'.
| | |
layer-style
| number | 1 | No | The style configuration of the personalized map does not support dynamic modifications. | No | No | No | | |
rotate | number | 0 | No | Rotation angle, ranging from 0 to 360, represents the angle between the map's true north and the device's Y-axis. | No | Yes | No | | |
skew | number | 0 | No | Inclination angle, ranging from 0 to 40, represents the tilt angle about the Z-axis. | System Map: No Tencent Map: Yes Baidu Map: Yes Amap: Yes | Yes | No | | |
enable-3D | boolean | false | No | Display 3D building blocks | System Map: No Tencent Map: Yes Baidu Map: No Amap: No | Google Map: Yes Huawei Map: Yes Tencent Map: Yes Baidu Map: Yes Amap: No | No | | |
show-compass | boolean | false | No | Display the compass | Yes | Yes | No | | |
show-scale | boolean | false | No | Display the scale bar | Yes | Google Map: No Huawei Map: No Tencent Map: Yes Baidu Map: Yes Amap: Yes | Yes | | |
enable-overlooking | boolean | false | No | Enable overhead view | System Map: No Tencent Map: Yes Baidu Map: Yes Amap: Yes | Yes | No | | |
enable-zoom
| boolean | true | No | Whether scaling is supported | Yes | Yes | Yes | | |
enable-scroll | boolean | true | No | Whether dragging is supported | Yes |
Yes
|
Yes
| | |
enable-rotate | boolean | - | No | Whether rotation is supported | Yes |
Yes
|
Yes
| | |
enable-satellite | boolean |
false
| No | Whether satellite imagery is enabled | Yes | Google Map: Yes Huawei Map: No Tencent Map: Yes Baidu Map: Yes Amap: Yes |
Type=google
| | |
enable-traffic | boolean | false | No | Whether the real-time traffic feature is enabled | Yes | Yes | Yes | | |
enable-poi | boolean | true | No | Whether display POI points | System Map: No Tencent Map: Yes Baidu Map: No Amap: No | Google Map: Yes Huawei Map: No Tencent Map: Yes Baidu Map: Yes Amap: Yes | Type=google | | |
enable-building | boolean | true | No | Whether display buildings | System Map: No Tencent Map: Yes Baidu Map: Yes Amap: Yes | Google Map: Yes Huawei Map: No Tencent Map: Yes Baidu Map: No Amap: Yes | Type=google | | |
setting | object | - | No | Configuration | No | No | Yes | | |
bindtap | eventhandle | - | No | Triggered upon clicking the map, returning latitude and longitude information. | Yes | Yes | Yes | | |
bindmarkertap | eventhandle | - | No | Triggered upon clicking the marker point, e.detail = {markerId} | Yes | Yes | Yes | | |
bindlabeltap | eventhandle | - | No | Triggered upon clicking the label, e.detail = {markerId} | Yes | No | Of type 'Tencent'. | | |
bindcontroltap | eventhandle | - | No | Triggered upon clicking the control, e.detail = {controlId} | No | No | No | | |
bindcallouttap | eventhandle | - | No | Triggered upon clicking the bubble corresponding to the marker point, e.detail = {markerId} | No | No |
Yes | | |
bindupdated | eventhandle | - | No | Triggered upon the completion of the map's rendering update. |
No
|
Yes
| Yes | | |
bindregionchange | eventhandle | - | No | Triggered twice when the field of view changes, returning type values of 'begin' and 'end' respectively. | Yes | Yes | Yes | | |
bindpoitap |
eventhandle
| - | No | Triggered upon clicking the map's POI point, e.detail = {name, longitude, latitude} | No | Yes | Yes | | |
bindanchorpointtap | eventhandle | - | No | Triggered upon clicking the location marker, e.detail = {longitude, latitude} | No | No | No | | |
e = {causedBy, type, detail: {rotate, skew, scale, centerLocation, region}}
// Default Valueconst setting = {rotate: 0,showLocation: false,subKey: '',layerStyle: 1,enableZoom: true,enableScroll: true,enableRotate: false,showCompass: false,enableSatellite: false,}this.setData({// Only the attributes that are set will take effect, and others will remain unaffected.setting: {enableZoom: false,enableScroll: false,}})
Attribute | Description | Type | Required | Remarks | Supported on iOS | Supported on Android | Supported on IDE |
id | Marker Point ID | number | No | The callback of a marker click event will return this ID. | Yes | Yes | Yes |
clusterId | Cluster ID | number | No | Used when customizing the effect of point aggregation clusters. | No | No | No |
joinCluster | Whether participate in point aggregation | boolean | No | No participation by default | No | Google Map: Yes Huawei Map: Yes Tencent Map: Yes Baidu Map: No Amap: No | No |
latitude | Latitude | number | Yes | Number of floating points, ranging from -90 to 90. | Yes | Yes | Yes |
longitude | Longitude | number | Yes | Number of floating points, ranging from -90 to 90. | Yes | Yes | Yes |
title | Marker point name | string | No | Displayed upon clicking, will ignored if callout exists. | Yes | Yes | Of type 'Tencent'. |
zIndex | Display Level | number | No | - | No | Yes | Yes |
iconPath | Displayed Icon | string | Yes | Image path under the project directory, supporting network path, local path, and code package path. | Yes | Yes | Yes |
rotate | Rotation angle | number | No | The angle of clockwise rotation, ranging from 0 to 360, with a default of 0. | No | Yes | Of type 'Tencent'. |
alpha | Marked transparency | number | No | Ranges from 0 to 1, with a default value of 1 that indicates no transparency. | No | Yes | Of type 'Tencent'. |
width | Mark icon width | number/string | No | Defaults to the actual image width. | No | Yes | No |
height | Mark icon height | number/string | No | Defaults to the actual height of the image. | No | Yes | No |
callout | Bubble window above the marker point. |
object
| No | See the table below for supported attributes. Newline characters are recognizable. | Yes | Yes | Yes |
customCallout | Customize the bubble window. | object | No | See the table below for supported attributes. | No | No | No |
label | Add labels adjacent to the marker points. | object | No | See the table below for supported attributes. Newline characters are recognizable. | No | No | Yes |
anchor | The latitude and longitude are at the anchor point of the marker icon, defaulting to the midpoint of the bottom edge. | object | No | {x, y}, where x represents the horizontal direction (0-1) and y represents the vertical direction (0-1). {x: .5, y: 1} denotes the midpoint of the bottom edge. | No | Yes | No |
aria-label | Accessibility, (Attribute) Additional description of the element. | string | No | - | No | No | No |
Attribute | Description | Type | iOS Compatibility | Android Compatibility | IDE Compatibility |
content | Text | string | Yes | Yes | Yes |
color | Text Color | string | No | Yes | Yes |
fontSize | Font Size | number | No | Yes | Yes |
borderRadius | Border chamfer | number | No | Yes | Yes |
borderWidth | Border Width | number | No | Yes | Yes |
borderColor | Outline color | string | No | Yes | Yes |
bgColor | Background Color | string | No | Yes | Yes |
padding | Text Padding | number | No | Yes | Yes |
display |
'BYCLICK': Display on Click; 'ALWAYS': Always Visible
| string | No | No | Yes |
textAlign |
Text Alignment Method. Valid values: left, right, center
| string | No | Yes | No |
anchorX |
Horizontal offset, with positive values indicating a shift to the right.
| number | No | Google Map: Yes Huawei Map: Yes Tencent Map: Yes Baidu Map: No Amap: Yes | No |
anchorY |
Vertical offset, with positive values indicating a downward shift.
| number | No | Google Map: Yes Huawei Map: Yes Tencent Map: Yes Baidu Map: No Amap: Yes | No |
customCallout
is present, the callout
and title
attributes will be ignored. The custom bubble uses cover-view
for customization, offering greater flexibility.Attribute | Description | Type | iOS Compatibility | Android Compatibility | IDE Compatibility |
display | 'BYCLICK': Display on Click; 'ALWAYS': Always Visible | string | No | No | No |
anchorX | Horizontal offset, with positive values indicating a shift to the right. | number | No | No | No |
anchorY | Vertical offset, with positive values indicating a downward shift. | number | No | No | No |
map
component. The cover-view
inside is bound to the marker
through the marker-id
attribute. When the marker
is created, the content displayed by this cover-view
will be displayed as a callout
above the marker point.<map><cover-view slot="callout"><cover-view marker-id="1"></cover-view><cover-view marker-id="2"></cover-view></cover-view></map>
Attribute | Description | Type | iOS Compatibility | Android Compatibility | IDE Compatibility |
content | Text | string | No | No | Yes |
color | Text Color | string | No | No | Yes |
fontSize | Font Size | number | No | No | Yes |
anchorX | The coordinates of the label, whose origin is the point defined by the longitude and latitude corresponding to the marker. | number | No | No | Yes |
anchorY | The coordinates of the label, whose origin is the point defined by the longitude and latitude corresponding to the marker. | number | No | No | Yes |
borderWidth | Border Width | number | No | No | Yes |
borderColor | Outline color | string | No | No | Yes |
borderRadius | Border chamfer | number | No | No | Yes |
bgColor | Background Color | string | No | No | Yes |
padding | Text padding | number | No | No | Yes |
textAlign | Text alignment method. Valid values: left, right, center. | string | No | No | Yes |
MapContext.on('markerClusterCreate', callback)
is triggered, the style of the aggregation cluster is updated through MapContext.addMarkers.Attribute | Description | Type | Required | Remarks | iOS Compatibility | Android Compatibility | IDE Compatibility |
points | Array of latitude and longitude coordinates | Array | Yes | [{latitude: 0, longitude: 0}] | Yes | Yes | Yes |
color | Color of the line | string | No | Hexadecimal | Yes | Yes | Yes |
colorList | Rainbow Line | Array | No | Ignore the color value when it exists
| No | Google Map: No Huawei Map: No Tencent Map: Yes Baidu Map: Yes Amap: Yes | No |
width | Line width | number | No | | Yes | Yes | Yes |
dottedLine | Is it a dashed line? | boolean | No | Defaults to "false" | Yes | Yes | Yes |
arrowLine | Line with an arrow | boolean | No | - | No | Yes | No |
arrowIconPath | Replace the arrow icon | string | No | - | No | Yes | No |
borderColor | Line border color | string | No | - | No | Google Map: No Huawei Map: No Tencent Map: Yes Baidu Map: No Amap: No | Yes |
borderWidth | Line thickness | number | No | - | No | Google Map: No Huawei Map: No Tencent Map: Yes Baidu Map: No Amap: No | Yes |
level | Overlay relationship | string | No | Defaults to "abovelabels" | No | Google Map: No Huawei Map: No Tencent Map: Yes Baidu Map: No Amap: No | No |
textStyle | Font Style | TextStyle | No | Text style on the polyline | No | Google Map: No Huawei Map: No Tencent Map: Yes Baidu Map: No Amap: No | No |
segmentTexts | Segmented text | Array<SegmentText> | No | Content and position of text on the polyline | No | Google Map: No Huawei Map: No Tencent Map: Yes Baidu Map: No Amap: No | No |
Attribute | Description | Type |
name | Name | string |
startIndex | Starting Point | number |
endIndex | End point | number |
Attribute | Description | Type | Default value |
textColor | Text Color | string | #000000 |
strokeColor | Outline color | number | #ffffff |
fontSize | Font Size | number | 14 |
level
field represents the overlay relationship with other map elements, with the following optional values:Value | Description |
abovelabels | Displayed above all POIs |
abovebuildings | Displayed above building blocks and below POIs |
aboveroads | Displayed above the road and below the building blocks |
Attribute | Description | Type | Required | Remarks | Supported on iOS | Supported on Android | Supported on IDE |
dashArray | Dotted boundary line |
Array<number> | No | The default value [0, 0] represents a solid line, [10, 10] signifies a dashed line composed of ten pixels of solid line and ten pixels of blank space (repeated in this manner). | No | Google Map: No Huawei Map: No Tencent Map: Yes Baidu Map: No Amap: No | No |
points | Array of latitude and longitude coordinates | array | Yes | [{latitude: 0, longitude: 0}] | Yes | Yes | Yes |
strokeWidth | Outline width | number | No | - | Yes | Yes | No |
strokeColor | Outline color | string | No | Hexadecimal | Yes | Yes | No |
fillColor | Filling Color | string | No | Hexadecimal | Yes | Yes | Yes |
zIndex | Set the Z-axis value for the polygon. | number | No | - | No | Yes | Yes |
level | Overlay relationship | string | No | Defaults to "abovelabels" | No | Google Map: No Huawei Map: No Tencent Map: Yes Baidu Map: No Amap: No | No |
Attribute | Description | Type | Required | Remarks | iOS Compatibility | Android Compatibility | IDE Compatibility |
latitude | Latitude | number | Yes | Number of floating points, ranging from -90 to 90. | Yes | Yes | Yes |
longitude | Longitude | number | Yes | Number of floating points, ranging from -180 to 180. | Yes | Yes | Yes |
color | Outline color | string | No | Number of floating points, ranging from -180 to 180. | Yes | Yes | Yes |
fillColor | Filling Color | string | No | Hexadecimal | Yes | Yes | Yes |
radius | Radius | number | Yes | - | Yes | Yes | Yes |
strokeWidth | Outline width | number | No | - | Yes | Yes | No |
level | Overlay relationship | string | No | Defaults to "abovelabels" | No | Google Map: No Huawei Map: No Tencent Map: Yes Baidu Map: No Amap: No | No |
Attribute | Description | Type | Required | Remarks | iOS Compatibility | Android Compatibility | IDE Compatibility |
id | Control id | number | No | This id will be returned in the callback of the control click event. | No | No | No |
position | Spatial position on the map | object | Yes | Spatial position relative to the map | No | No | No |
iconPath | Displayed Icon | string | Yes | Image path in the project directory, supporting local path and code package path. | No | No | No |
clickable | Whether it can be clicked | boolean | No | By default, it cannot be clicked. | No | No | No |
Attribute | Description | Type | Required | Remarks | iOS Compatibility | Android Compatibility | IDE Compatibility |
left | Distance to the left boundary of the map | number | No | Defaults to 0. | No | No | No |
top | Distance to the top boundary of the map | number | No | Defaults to 0. | No | No | No |
width | Spatial width | number | No | Defaults to the image width. | No | No | No |
height | Spatial height | number | No | Defaults to the image height. | No | No | No |
Attribute | Description | Type | Remarks |
type | Triggered at the onset and conclusion of the changes to the field. | string | The onset of the change to the field of view is denoted as 'begin', and its conclusion as 'end'. |
causedBy | The cause leading to the change to the field of view. | string | Induced by dragging the map (drag), scaling (scale), or invoking the interface (update). |
scale | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
Proportion | 1000km | 500km | 200km | 100km | 50km | 50km | 20km | 10km | 5km |
scale | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
Proportion | 2km | 1km | 500m | 200m | 100m | 50m | 50m | 20m | 10m |
Was this page helpful?