测试了很多次,一直不显示,最后发现问题所在:
(1) :polygon=“polygons” ,不要写成:polygons=“polygons”,支付宝小程序官方文档中是polygon而不是polygons
(2)fillColor,官文档中明确标识需要8位16进制颜色代码,如果你写6位的或者red之类的,就不会显示
<template>
<view>
<view class="page-body">
<view class="page-section page-section-gap">
<map id="mapInfo" ref="mapInfo" style="width: 100%; height: 300px;" :latitude="latitude" :longitude="longitude" :polygon="polygons">
</map>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
"longitude": 120.10775,
"latitude": 30.264786,
screenHeight: '800px',
markerList: [],
"polygons":[{
points: [{// 右