0

I followed the steps from the main git: https://github.com/Asymmetrik/ngx-leaflet

first I installed the required libraries (leaflet, leaflet-draw, leaflet-ngx, and leaflet-draw-ngx)

then I declared the required directive imports in app.module.

In my view I set the following:

<div class="col-md-6" style="height: 400px;"
         leaflet
         leafletDraw
         [leafletOptions]="options"
         [leafletLayers]="layers"
         [leafletLayersControl]="layersControl"
         [leafletDrawOptions]="drawOptions">
</div>

but I get the following error:

> Uncaught Error: Template parse errors:
Can't bind to 'leafletDrawOptions' since it isn't a known property of 'div'. ("fletDraw [leafletOptions]="options" [leafletLayers]="layers" [leafletLayersControl]="layersControl" [ERROR ->][leafletDrawOptions]="drawOptions"> </div> <div class="col-md-6"> <table class="table table-striped c"): ng:///gxxxx.html@0:258
    at syntaxError (compiler.es5.js?524d:1689)
    at TemplateParser.parse (compiler.es5.js?524d:12802)
    at JitCompiler._compileTemplate (compiler.es5.js?524d:26852)
    at eval (compiler.es5.js?524d:26772)
    at Set.forEach (<anonymous>)
    at JitCompiler._compileComponents (compiler.es5.js?524d:26772)
    at eval (compiler.es5.js?524d:26659)
    at Object.then (compiler.es5.js?524d:1679)
    at JitCompiler._compileModuleAndComponents (compiler.es5.js?524d:26658)
    at JitCompiler.compileModuleAsync

I am new to angular 4, I'm I doing something wrong ? or is it related to ES version ?

-1

Add the leaflet-draw module to the module where its been used

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.