Flat Map Component
 flatMapComponent007view, link (63 KB, 900400) source (272.5 KB)Wed, 2 May 07, 11:04am CDT 
 

Added a day/night terminator feature (see showDayAndNightRegions property below). Updated documentation:

methods:

  • addLine(defObj) - adds a latitude and/or longitude line to the map; valid properties for defObj are lat and lon, as well as the optional style properties thickness, color, and alpha
  • removeAllLines() - removes all lines created with addLine
  • addObject(linkageName, name, posObj, initObj) - adds an object (that is, a movieclip) to the map; linkageName specifies the movieclip to attach, name identifies the object, posObj gives the location (defined by lat and lon properties), and initObj is an optional argument used when attaching the movieclip
  • setObjectPosition(name, posObj) - repositions an attached object; posObj should have lat and lon properties defined
  • passDataToObject(name, dataObj) - since objects can wrap around the edge of the map the component attaches several copies of the object; this means that if you want to communicate with an object you actually need to communicate with several movieclip instances; this function accomplishes that task by calling the function receiveData on each movieclip instance with dataObj as the argument (so you'll need to define a receiveData function on your objects)
  • removeObject(name) - removes the attached object with that name
  • removeAllObjects()- removes all objects attached with addObject

properties:

  • numberOfLatitudeDivisions, numberOfLongitudeDivisions - these set how many horizontal and vertical divisions to use for the border and grid; call updateGrid and updateBorderAndLabels after changing
  • borderWidth, borderLightColor, borderDarkColor, borderLabelMargin - these properties control the appearance of the border; call updateBorderAndLabels after changing
  • useKiribatiIDL - this property specifies whether to use the international date line with the relatively new Kiribati borders; call updateIDL after changing
  • IDLLineThickness, IDLLineColor, IDLLineAlpha - these are the style properties for the international date line; call updateIDL after changing these properties
  • gridThickness, gridColor, gridAlpha - these are the style properties for the latitude and longitude grid lines; call updateGrid after changing these properties
  • defaultLineThickness, defaultLineColor, defaultLineAlpha - these are the default style properties to use for lines created with addLine
  • showLongitudeGrid - shows or hides the lines of longitude
  • showLatitudeGrid - shows or hides the lines of latitude
  • showIDL - shows or hides the international date line
  • showBorderLabels - shows or hides the labels around the border
  • longitudeOffset - the longitude of the map along the left edge
  • allowDragging - specifies whether the map can be dragged to change the longitude offset; if onDragHandler is defined a function with that name will be called (on the parent of the component) when the the map is dragged
  • showDayAndNightRegions - shows or hides the day and night regions (default is false)
  • sunDeclination, sunLongitude - these properties control the shape and longitude offset of the day and night regions (if you want an icon on the map to indicate where the sun is at zenith you will need to add an object)
  • terminatorThickness, terminatorColor, terminatorAlpha, nightSideFillColor, nightSideFillAlpha, daySideFillColor, daySideFillAlpha - these properties control the appearance of the day and night regions; call updateDayAndNightRegions after changing

 
 flatMapComponent005view, link (61.3 KB, 900400) source (488 KB)Thu, 5 Apr 07, 2:33pm CDT 
 

methods:

  • addLine(defObj) - adds a latitude and/or longitude line to the map; valid properties for defObj are lat and lon, as well as the optional style properties thickness, color, and alpha
  • removeAllLines() - removes all lines created with addLine
  • addObject(linkageName, name, posObj, initObj) - adds an object (that is, a movieclip) to the map; linkageName specifies the movieclip to attach, name identifies the object, posObj gives the location (defined by lat and lon properties), and initObj is an optional argument used when attaching the movieclip
  • setObjectPosition(name, posObj) - repositions an attached object; posObj should have lat and lon properties defined
  • passDataToObject(name, dataObj) - since objects can wrap around the edge of the map the component attaches several copies of the object; this means that if you want to communicate with an object you actually need to communicate with several movieclip instances; this function accomplishes that task by calling the function receiveData on each movieclip instance with dataObj as the argument (so you'll need to define a receiveData function on your objects)
  • removeObject(name) - removes the attached object with that name
  • removeAllObjects()- removes all objects attached with addObject

properties:

  • numberOfLatitudeDivisions, numberOfLongitudeDivisions - these set how many horizontal and vertical divisions to use for the border and grid; call updateGrid and updateBorderAndLabels after changing
  • borderWidth, borderLightColor, borderDarkColor, borderLabelMargin - these properties control the appearance of the border; call updateBorderAndLabels after changing
  • useKiribatiIDL - this property specifies whether to use the international date line with the relatively new Kiribati borders; call updateIDL after changing
  • IDLLineThickness, IDLLineColor, IDLLineAlpha - these are the style properties for the international date line; call updateIDL after changing these properties
  • gridThickness, gridColor, gridAlpha - these are the style properties for the latitude and longitude grid lines; call updateGrid after changing these properties
  • defaultLineThickness, defaultLineColor, defaultLineAlpha - these are the default style properties to use for lines created with addLine
  • showLongitudeGrid - shows or hides the lines of longitude
  • showLatitudeGrid - shows or hides the lines of latitude
  • showIDL - shows or hides the international date line
  • showBorderLabels - shows or hides the labels around the border
  • longitudeOffset - the longitude of the map along the left edge
  • allowDragging - specifies whether the map can be dragged to change the longitude offset; if onDragHandler is defined a function with that name will be called (on the parent of the component) when the the map is dragged