Commit 8547dedf authored by Amy Stamile's avatar Amy Stamile
Browse files

Added back in shapesToWKT

parent 3c7edc94
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -101,6 +101,23 @@ export default L.Control.AstroDrawFilterControl = L.Control.Draw.extend({
    navigator.clipboard.writeText(copyText.value);
  },

  /**
   * @function AstroDrawFilterControl.prototype.shapesToWKT
   * @description Is called when a user draws a shape using the on map drawing features.
   *              Converts the shaped drawn into a Well-Known text string.
   * @param  {DomEvent} e  - On draw.
   */
  shapesToWKT: function(e) {
    this.myLayer.clearLayers();
    this.options.edit["featureGroup"].clearLayers();

    this.options.edit["featureGroup"].addLayer(e.layer);
    let geoJson = e.layer.toGeoJSON();
    geoJson = geoJson["geometry"];

    this.wkt.read(JSON.stringify(geoJson));
  },

  /**
  * @function AstroDrawFilterControl.clearMap
  * @description clears the layers on map