Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mjhram opened this issue Dec 27, 2019 · 1 comment
Closed
Labels
type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Milestone

Comments

@mjhram
Copy link

mjhram commented Dec 27, 2019

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();
                  }
              });
    
@mjhram mjhram added triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Dec 27, 2019
@barbeau barbeau removed the triage me I really want to be triaged. label Jan 29, 2020
@barbeau
Copy link
Collaborator

barbeau commented Jan 29, 2020

@mjhram Thanks for the report! This was just fixed in the master branch by merging #380. There is a new MultiLayerDemoActivity in the master branch that demonstrates that multiple KML layers (along with GeoJSON, etc.) now work on the same map!

@barbeau barbeau closed this as completed Jan 29, 2020
@arriolac arriolac added this to the 1.0 milestone Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

3 participants