Getting Started with GoogleMap API-Drawing and lines

Source: Internet
Author: User
Tags polyline

Drawing and lines are used polygon and polyline respectively, the process is as follows

1. Define a drawing information-related object, which can be applied to both drawing and drawing lines

1 var 2 {3    paths: [],4     strokecolor: "#FF0000",5     strokeopacity:0.8,6     strokeweight:2,7     fillcolor: "#FF0000" , 8     fillopacity:0.359 }

2. Draw polygons, there are two kinds of drawing

    • You can setmap first, then SetPath.
    • You can set the path parameter directly, and then behind the Setmap
1 var New Google.maps.Polygon (polyoption); 2 bermudatriangle.setmap (map); 3 bermudatriangle.setpath (trianglecoords)

3. Draw lines, same as

1 var New Google.maps.Polyline (polyoption); 2 linearea.setmap (map); 3 linearea.setpath (trianglecoords)

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.