Skip to content

KmlLayer containers are only exposed after calling addLayerToMap() #773

@rrforte

Description

@rrforte

Calling KmlLayer::getContainers() returns null when calling it prior to adding the layer to the map by calling KmlLayer::addLayerToMap(). This makes it impossible to retrieve containers (and nested data) without adding the layer to the map first, and also causes KmlLayer::hasContainers() to fail with a NullPointerException.

The cause is that KmlRenderer::mContainers is only set during addLayerToMap (and retains its initial null value until that point).

A current workaround seems to call addLayerToMap() followed by removeLayerFromMap() though this is far from ideal.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions