* @return the new GPX and marker layers corresponding to the specified GPX data, to be used with {@link #addLayers}
* @see #addLayers
*/
public static GpxImporterData loadLayers(final GpxData data, final boolean parsedProperly,
final String gpxLayerName, String markerLayerName) {
GpxLayer gpxLayer = null;
MarkerLayer markerLayer = null;
if (data.hasRoutePoints() || data.hasTrackPoints()) {
gpxLayer = new GpxLayer(data, gpxLayerName, data.storageFile != null);
}
if (Main.pref.getBoolean("marker.makeautomarkers", true) && !data.waypoints.isEmpty()) {
markerLayer = new MarkerLayer(data, markerLayerName, data.storageFile, gpxLayer);
if (markerLayer.data.isEmpty()) {
markerLayer = null;