Advanced Flash Components
Search!
Search!
Home >  Tutorials >  Map >  Adding Polylines to Map
Adding Polylines to Map
Updated: Apr 23, 2008   Views: 2202  
Description: This tutorial will go through the steps to add a polyline using XML file


Part I - Installing Map component

Please see this installation tutorial on how to add Map component. Once it has been installed drag a instance of the map to the stage.

Part II - Setting up the XML file
The polylines are set up in the XML file. This is the structure needed to create a polyline.

<content>
    <polyline size="2" color="0xFF9D00">
          <point>
                <data>0</data>
                <description>Denver, United States</description>
                <descriptionType>text</descriptionType>
                <icon>airplane_mc</icon>
                <latitude>39</latitude>
                <longitude>-104</longitude>
           </point>
    </polyline>
</content>


Part III - Setting up Polyline
First you will need a content tag. Then within this tag is where you can add all the points and lines you want. After this you will need to state the line's stroke width and color.

<content>
    <polyline size="2" color="0xFF9D00">


Part IV - Adding a point in the line
Now we will setup the points need to create the line. For each point you will need to state  a description, marker icon, and the lat/long position of the marker.

<data>0</data>
<description>Denver, United States</description>
<descriptionType>text</descriptionType>
<icon>airplane_mc</icon>
<latitude>39</latitude>
<longitude>-104</longitude>


Part V - Markers
Our marker icons are movie clips stored in the library. You can use any icon you want. Once you have created a movieclip you will need to make sure that you have setup linkage id for the movieclip. Then delete it off stage. Once linkage is setup you will jsut need to referance the movie clip name within the icon tag in XML file.

<icon>airplane_mc</icon>


After all your point is setup you will need to add more points with all fields specified.When your done you will need to close up the xml file by ending with..

</content>
Component Info
Map