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
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.
Show a friend, family member, or teacher what you've done!
Here is a share link to your code:
Does your code work? Want to run it on your iPhone?
Here's your code:
Use [Control]-[C] (Windows) or [⌘]-[C] (MacOS) to copy your code.
Paste it using [Control]-[V] (Windows) or [⌘]-[V] (MacOS) into
Then click the "Use on iPhone" button that you'll see.