WeChat mini-app map details and simple examples

Source: Internet
Author: User
This article mainly introduces the details of map and simple examples of small programs. For more information, see Applet map

Applet map

Map


Attribute name Type Default value Description
Longpolling Number Central longitude
Latitude Number Central Latitude
Scale Number 1 Zoom level
Markers Array Mark Point
Covers Array Covering

Mark Point

A markup point is used to display the marked position on a map. you cannot customize icons and styles.


Attribute Description Type Required Remarks
Latitude Latitude Number Yes Floating point number in the range of-90 ~ 90
Longpolling Longitude Number Yes Floating point number, range:-180 ~ 180
Name Name Tagging String Yes
Desc Detailed description String No

Covering

A cover is used to display custom icons and styles on a map.


Attribute Description Type Required Remarks
Latitude Latitude Number Yes Floating point number in the range of-90 ~ 90
Longpolling Longitude Number Yes Floating point number, range:-180 ~ 180
IconPath Displayed icon String Yes Path of the image under the Project Directory, supporting relative path writing
Rotate Rotation angle Number No Clockwise rotation angle, ranging from 0 ~ 360. the default value is 0.

The longitude and latitude of the map component are required. if the longitude and latitude are not specified, the default value is the longitude and latitude of Beijing.

Markers can only be set during initialization. dynamic updates are not supported.

Example:

 

// Map. jsPage ({data: {markers: [{latitude: 23.099994, longpolling: 113.324520, name: 'T. I .T creative park ', desc: 'My current location'}], covers: [{latitude: 23.099794, longpolling: 113.324520, icaonPath :'.. /images/car.png ', rotate: 10}, {latitude: 23.099298, longpolling: 113.324129, iconPath :'.. /images/car.png ', rotate: 90}]})

Bug & Tip

Tip: Do not use the map component in scroll-view.

Thank you for reading this article. I hope it will help you. thank you for your support for this site!

For more details about map of applets and simple examples, please refer to PHP Chinese network!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.