Tutorial - Markers

Create a map with a tile layer, define some data, and create a feature layer.

Step 1
Active
Inactive

Create a marker feature and set the data. The default marker feature looks just line a point feature -- circles with borders.

Step 2
Active
Inactive

Markers have many different symbols and style options:

  • symbol: the symbol shape, enumerated in geo.markerFeature.symbols. This includes ellipse, triangle (isosceles triangles), rectangle, oval, and drop. There are symmetric repeating patterns such as cross4, flower6, star5, jack6, and drop8, where the number is the rotational symmetry from 2 to 16.
  • symbolValue: a number that modifies how the symbol appears, usually in the range of [0, 1]. This is often the ratio of the minor axis of the symbol to its major axis. For triangle, it is the length of the base side compared to the identical sides.
  • rotation: the rotation in radians.
  • rotateWithMap: a boolean; if true, the symbol rotates when the map is rotated. If false, it remains in the same orientation on the screen.
  • radius: in pixels. This includes the stroke width, if any.
  • strokeWidth: the width of the stroke around the symbol in pixels.
  • scaleWithZoom: one of the values defined in geo.markerFeature.scaleModes. If none, the symbols remains the same size when the map is zoomed. This can also be fill, stroke, or all, in which case the symbol will change size when the map is zoomed. The radius and strokeWidth are in pixels at zoom level 0.
  • fillColor
  • fillOpacity
  • strokeColor
  • strokeOpacity:
Step 3
Active
Inactive

When scaling a marker with the map, the radius and stroke width are the values at zoom level 0.

Step 4
Active
Inactive

Markers are drawn efficiently, even if they all have different styles. This creates a large sample of symbols, each with a different style.

Step 5
Active
Inactive