Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Leaflet save layerGroup in file

I stucked with a problem in my application. Few words about it:

  • app is an leaflet based map;
  • map starts in Android WebVeiw;
  • map include few marker-layers;
  • layers can control with LayerControl;
  • on right click on a map open contextmenu;
  • in contextmenu user can create new marker in clicked location;
  • also in contextmenu user can delete this marker;
  • one click on marker change its icon;
  • user created markers adds to separate layerGroup;

I need to create a button on my map, that onClick will save layerGroup with user created markers in some file(may be database), that store all the parameters of markers and then can load into map how it was on created.

So, please, help me. I don't know how to realize this function. LayerGroup is an Object. When I try method .toGeoJSON() it converts markers into points, that has not icons properties.

Comments