In the lesson on markers, you saw how setmarker could be used
to place a famous red Google Markers on a map. In this lesson, you'll see how you can draw a smooth trail (or line) through a bunch
of latitude,longitude points.
Drawing a trail involves telling the map a bunch of points through which the trail should be drawn. These points are best organized
in two arrays: one array for the latitudes, and the other for the longitudes. Thus, we give you drawtrail, that works
like this:
drawtrail(lat-array,long-array)
Move the mouse over a dotted box for more information.
Now you try.
Try out our demonstration, but next, draw a square around your house or school.
Type your code here:
See your results here:
This code will draw a trianglular trail around the Bermuda Triangle.
Share your code
Show a friend, family member, or teacher what you've done!