WeChat mini program map map
WeChat applet map
MAP
Marking point
Marking point is used to display the marked location on the map. It cannot Custom icons and styles
Overlay
Overlay is used to display custom icons on the map. Customizable icons and styles
The longitude and latitude of the map component is required. If you do not fill in the longitude and latitude, the default value is the longitude and latitude of Beijing.
Markers can only be set during initialization and do not support dynamic updates.
Example:
<!-- map.wxml --> <map longitude="23.099994" latitude="113.324520" markers="{{markers}}" covers="{{covers}}" style="width: 375px; height: 200px;"></map>
// map.js Page({ data: { markers: [{ latitude: 23.099994, longitude: 113.324520, name: 'T.I.T 创意园', desc: '我现在的位置' }], covers: [{ latitude: 23.099794, longitude: 113.324520, icaonPath: '../images/car.png', rotate: 10 }, { latitude: 23.099298, longitude: 113.324129, iconPath: '../images/car.png', rotate: 90 }] } })
Bug & Tip
tip
: Do not use themap
componentin
scroll-view