When creating a project, you may need to draw a prediction path, which is usually drawn by dotted lines. After checking for a long time, I found this demo on a googleMap official website on a colleague's recommendation. I will summarize the demo for you to refer to the Code for [javascript] functiondrawPrePath (... syntaxHighlighter is used to draw a prediction path in a project. Generally, it is drawn by dotted lines. After checking for a long time, I found this demo on a googleMap official website on a colleague's recommendation. I will summarize the demo for you to refer to the Code for [javascript] function drawPrePath (array, color) {var sorrow = {path: google. maps. symbolPath. FORWARD_CLOSED_ARROW // arrow}; var lineSymbol = {path:'m 0,-1 0, 1 ', strokeOpacity: 1, scale: 3}; var pathCoord = [new google. maps. latLng (37.772323,-122.214897), new google. maps. latLng (21.291982,-157.821856), new google. maps. latLng (-18.142599, 1 78.431), new google. maps. latLng (-27.46758, 153.027892)]; path = new google. maps. polyline ({path: pathCoord, strokeColor: "# 2d2d2d", strokeOpacity: 0, strokeWeight: 2, icons: [{icon: lineSymbol, offset: '0', repeat: '20px '}], map: map}); path. setMap (map);} key code: var lineSymbol = {path:'m 0,-1 ', strokeOpacity: 1, scale: 3}; key:'m 0, -1, ': Actually, this is the method for drawing the path of SVG. I still cannot explain the specific meaning. Learn svg tutorials by yourself!
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