Showing latitude and longitude in ember-leaflet-draw


#1

Is there a way of showing the longitudes and latitude of the locations where we click when drawing a polygon on the map using ember-leaftlet-draw(https://github.com/StevenHeinrich/ember-leaflet-draw)? I’ve read the docs for leaflet-draw(https://leaflet.github.io/Leaflet.draw/docs/leaflet-draw-latest.html#l-edit-poly) but can’t seem to translate it into ember

template.hbs

{{#leaflet-map onLoad=(action ‘initMap’) onClick=(route-action ‘getLatLng’) lat=lat lng=lng zoom=zoom class=‘leaflet_map’}}

 {draw-control position="topright" showDrawingLayer=true enableEditing=true 
  drawingFinishedAction='handleDrawingFinishedAction' }}

{{/leaflet-map}}


#2

Ok, after looking into the docs for hours i found the answer

template.hbs

           {{draw-control position="topright" showDrawingLayer=true enableEditing=true 
           drawingFinishedAction='handleDrawingFinishedAction' onDrawCreated=(action 'clicked')}}

component,js

                 clicked(e){
                   console.log(e.layer.getLatLngs())
                    }