Detailed explanation of WeChat applet wxapp map map

高洛峰
Release: 2017-02-14 14:30:46
Original
1495 people have browsed it

WeChat applet wxapp map map:

map


Attribute nameTypeDefault valueDescription
longitudeNumber Center Longitude
latitudeNumber Center Latitude
scaleNumber1zoom level
markersArray Marked points
coversArray Overlay

Marker point

Marker point is used to display the location of the marker on the map. The icon and Style


##latitudeLatitudeNumber isFloating point number, range -90 ~ 90longitudeLongitudeNumber isFloating point number, range -180 ~ 180nameMark the nameString is descDetailed description of the mark pointStringNo
AttributeDescriptionTypeRequired Fill in Remark

Overlay

Overlay is used to display custom icons on the map, the icon and style can be customized


AttributeDescriptionTypeRequiredRemarkslatitudeLatitudeNumber is a floating point number, ranging from -90 ~ 90longitudeLongitudeNumber is a floating point number, ranging from -180 ~ 180iconPathThe displayed icon String is the image path in the project directory and supports relative path writing. rotateRotation angleNumberNoThe angle of clockwise rotation, range 0 ~ 360, the default is 0
The longitude and latitude of the map component is required. If the longitude and latitude are not filled in, 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.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
  }]
 }
})
Copy after login

Thank you for reading, I hope it can help everyone, thank you for your support of this site!

For more WeChat applet wxapp map map detailed explanation and related articles, please pay attention to the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!