The load method for GeoJsonDataSource takes a number of options that related to style defaults -- marker size, color, and symbol, stroke and fill options, etc. The current implementation for KML hard codes a lot of this and doesn't expose any way to override them -- the code has nine instances of the string Color.WHITE, for example, and billboards are built around a constant called BILLBOARD_SIZE that can't be modified. Technically, these properties can be modified after the fact by altering entities in the collection, but only by taking some liberties guessing what might have been derived from a default instead of specified in the source document. (My current workaround actually grabs the private _pinBuilder, because the only way to tell if the billboard is a default is to do an equality-comparison against the cached canvas!)
The original code wasn't really written with customization in mind (and is over 4k LOC in a single file!) so I haven't taken a crack at this myself yet. My fast-and-lose workaround lets me apply some customizations in a way that works well enough, for me, for now, but if anybody ever gets around to refactoring it, I'd like for them to keep this in mind.
Trackback to this suggestion I made in Community. If this feature gets added, it might be a good time to rethink what the default-default (as opposed to overridden-default) styles are for KML.
The
load
method forGeoJsonDataSource
takes a number of options that related to style defaults -- marker size, color, and symbol, stroke and fill options, etc. The current implementation for KML hard codes a lot of this and doesn't expose any way to override them -- the code has nine instances of the stringColor.WHITE
, for example, and billboards are built around a constant calledBILLBOARD_SIZE
that can't be modified. Technically, these properties can be modified after the fact by altering entities in the collection, but only by taking some liberties guessing what might have been derived from a default instead of specified in the source document. (My current workaround actually grabs the private_pinBuilder
, because the only way to tell if the billboard is a default is to do an equality-comparison against the cached canvas!)The original code wasn't really written with customization in mind (and is over 4k LOC in a single file!) so I haven't taken a crack at this myself yet. My fast-and-lose workaround lets me apply some customizations in a way that works well enough, for me, for now, but if anybody ever gets around to refactoring it, I'd like for them to keep this in mind.