Question: Lets say I draw a shape on a mapbox map, and do this on the draw:crated event:

```
 e.layer.properties = {};
 e.layer.properties.myId = 'This is myId';

```

If I do a `featureGroup.toGeoJSON()` the geojson features has an empty properties object. Is there any way I configure a leaflet layer so that when it is transformed to geoJson, it will have certain properties set?

Answer: 
Actually, the trick is just to define the layer `feature` with its `type` (must be a `"Feature"`) and `properties` (use the latter to record whatever information you need).

```js
map.on('draw:created', function (event) {
    var layer = event.layer,
        feature = layer.feature = layer.feature || {}; // Initialize feature

    feature.type = feature.type || "Feature"; // Initialize feature.type
    var props = feature.properties = feature.properties || {}; // Initialize feature.properties
    props.myId = 'This is myId';
    drawnItems.addLayer(layer); // whatever you want to do with the created layer
});

```

See also [Leaflet Draw not taking properties when converting FeatureGroup to GeoJson](https://stackoverflow.com/questions/35760126/leaflet-draw-not-taking-properties-when-converting-featuregroup-to-geojson/35819611#35819611) and [update properties of geojson to use it with leaflet](https://stackoverflow.com/questions/34738805/update-properties-of-geojson-to-use-it-with-leaflet?noredirect=1&lq=1)
You can either modify the leaflet source or write your own function to process the layers and set the properties that you are looking for.