StylesOptions Object

Setting the options for an individual shape is easy to do. However, sometimes you need to load a collection of shapes from a module. To set the style for these, one option would be to loop through each shape and set the style for that shape individually. This means writing extra code and looping through all of the entities in your high-volume data. To make it easier to set the default styles for loaded entities, many of the modules allow you to pass in an StylesOptions object. Some of the modules that support this include GeoJSON, Well Known Text, and the Spatial Data Services modules.


This IStylesOptions object has the following properties.

Name Type Description
pushpinOptions PushpinOptions Sets the options for all pushpins.
polylineOptions PolylineOptions Sets the options for all polylines.
polygonOptions PolygonOptions Sets the options for all polygons.


var style = {
    pushpinOptions: {
        color: 'pink'
    polylineOptions: {
        strokeColor: 'green'
    polygonOptions: {
        fillColor: 'red',
        strokeColor: 'blue'