Skip to content

passing Null "feature" to onFeatureClick when loading multiple KmlLayer #593

Closed
@mjhram

Description

@mjhram

Hi,
API ver: android-maps-utils:0.6.2
OS: android
issue: when adding multiple KmlLayers, the app crashes when clicking on any item in the KmlLayer.
How to reproduce:

  • add 2 KmlLayers (for example using "new KmlLayer" twice)

  • click on any item. It will crash, since feature is null in the onFeatureClick!!

             KmlLayer kmlLayer = new KmlLayer(mMap, new ByteArrayInputStream(byteArr), 
             KmlDemoActivity.this);
              kmlLayer.addLayerToMap();
              kmlLayer.setOnFeatureClickListener(new KmlLayer.OnFeatureClickListener() {
                  @Override
                  public void onFeatureClick(Feature feature) {
                      Toast.makeText(KmlDemoActivity.this,
                              "Feature clicked: " + feature.getId(),
                              Toast.LENGTH_SHORT).show();
                  }
              });
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions