Skip to content
This repository was archived by the owner on Apr 7, 2020. It is now read-only.
This repository was archived by the owner on Apr 7, 2020. It is now read-only.

Demo page throws error when deleting feature #16

Open
@tomsaleeba

Description

@tomsaleeba
Contributor

Steps:

  • open the index.html demo page
  • draw a feature
  • delete the feature
  • check the JS console

Expected:
The feature is deleted and no errors are shown in the console.

Actual:
The feature is deleted but the following error is shown in the console

angular.js:12477 ReferenceError: layer is not defined
    at Object.deleted ((index):77)
    at (index):95
    at n.$emit (angular.js:16238)
    at ui-leaflet.js:4951
    at n.$eval (angular.js:15989)
    at n.$digest (angular.js:15800)
    at angular.js:16028
    at e (angular.js:5507)
    at angular.js:5784

The problem is the drawnItems.removeLayer(layer); line. I've found that making the whole deleted handler function a NOOP one like most of the others fixes the problem. The feature is deleted and no errors are thrown. I'll submit a pull request.

Activity

added a commit that references this issue on Apr 19, 2017

angular-ui#16 fixed from forked repo by removing the body of the dele…

added a commit that references this issue on Jun 7, 2017

Merge pull request #17 from tomsaleeba/master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @tomsaleeba

        Issue actions

          Demo page throws error when deleting feature · Issue #16 · angular-ui/ui-leaflet-draw