AS Declutter Documentation

Declutter enables you to clean up your map image when multiple points of interest (POIs) intersect. It has gone over a few changes and improvements. The biggest being declutter is now not a part of the base build, so you don't have to carry around the weight of declutter if you are not using it. There is also just one mode of declutter, so it is either on or off.

CircleDeclutter Object

The CircleDeclutter object is constructed with no parameters. Set it to a map's declutter property.

    		myMap.declutter = new CircleDeclutter();

To turn declutter off, set the map's declutter property to null.
    		myMap.declutter = null;
		

LeaderLines Object

Leader Lines are the lines that connect a decluttered POI from the actual location to the icon. Leader Line properties can be manipulated to change some of the style of the declutter.
A LeaderLines object gets set to a map's leaderLines property.
    		myMap.leaderLines = new LeaderLines();
		

The table below goes over the properties associated with the LeaderLines object

Property Description Example
alpha Use this parameter to set alpha value of the leader lines.
lines.alpha = .5;
dotMode Use this parameter to set the type of dot on the leader line
  • 0 - No Dot
  • 1 - Default Dot
  • 2 - Image Dot
lines.dotMode = 2;
dotIcon Use this parameter to set a Class object to use as an icon for the dot of the leader line, if dotMode 2 is being used
[Embed (source="image.gif")] private var imageIcon:Class; lines.dotMode = 2; lines.dotIcon = imageIcon;
dotImageURL Use this parameter to set an image URL to use as an icon for the dot of the leader line, if dotMode 2 is being used
lines.dotMode = 2; lines.dotImageURL = "image.gif";
lineColor Use this parameter to set a color to be used for the leader line
lines.lineColor = 0xfff000;


The table below goes over the functions associated with the LeaderLines object

Function Description Example
removeLine(poi:Poi):void Use this function to remove the leader line from a decluttered POI

  • - Parameters(s): The POI to remove the line from
  • - Returns: void
lines.removeLine(poi);
removeAllLines():void Use this function to remove all the leader lines from the map

  • - Parameters(s): none
  • - Returns: void
lines.removeAllLines();
drawLine(poi:Poi):void Use this function to draw the leader line from a decluttered POI to its location

Note: This function would only be used if you have already called lines.removeLine(poi) or lines.removeAllLines()

  • - Parameters(s): The POI to draw the line to
  • - Returns: void
lines.drawLine(poi);
drawAllLines():void Use this function to draw all the leader lines for all the POIs

Note: This function would only be used if you have already called lines.removeLine(poi) or lines.removeAllLines()

  • - Parameters(s): none
  • - Returns: void
lines.drawAllLines();